summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/passwd.cxx26
-rw-r--r--sfx2/source/dialog/passwd.hrc3
-rw-r--r--sfx2/source/dialog/passwd.src16
3 files changed, 45 insertions, 0 deletions
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index 0999ae5436..d454c8c6b4 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -103,6 +103,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
maPasswordED ( this, SfxResId( ED_PASSWD_PASSWORD ) ),
maConfirmFT ( this, SfxResId( FT_PASSWD_CONFIRM ) ),
maConfirmED ( this, SfxResId( ED_PASSWD_CONFIRM ) ),
+ maMinLengthFT ( this, SfxResId( FT_PASSWD_MINLEN ) ),
maPasswordBox ( this, SfxResId( GB_PASSWD_PASSWORD ) ),
maOKBtn ( this, SfxResId( BTN_PASSWD_OK ) ),
maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ),
@@ -110,6 +111,9 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ),
mnMinLen ( 5 ),
+ maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ) ),
+ maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ) ),
+ maMainPwdStr ( ),
mnExtras ( 0 ),
mbAsciiOnly ( false )
@@ -123,6 +127,25 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
if ( pGroupText )
maPasswordBox.SetText( *pGroupText );
+
+//set the text to the pasword length
+ SetPasswdText();
+}
+
+// -----------------------------------------------------------------------
+
+void SfxPasswordDialog::SetPasswdText( )
+{
+//set the new string to the minimum password length
+ if( mnMinLen == 0 )
+ maMinLengthFT.SetText( maEmptyPwdStr );
+ else
+ {
+ maMainPwdStr = maMinLenPwdStr;
+ maMainPwdStr.SearchAndReplace( String::CreateFromAscii( "$(MINLEN)" ), String::CreateFromInt32((sal_Int32) mnMinLen ), 0);
+ maMinLengthFT.SetText( maMainPwdStr );
+ maMinLengthFT.Show();
+ }
}
// -----------------------------------------------------------------------
@@ -130,6 +153,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
void SfxPasswordDialog::SetMinLen( USHORT nLen )
{
mnMinLen = nLen;
+ SetPasswdText();
EditModifyHdl( NULL );
}
@@ -189,8 +213,10 @@ short SfxPasswordDialog::Execute()
aPos = maUserED.GetPosPixel();
maPasswordED.SetPosPixel( aPos );
+ aPos = maConfirmFT.GetPosPixel();
maConfirmFT.SetPosPixel( aPwdPos1 );
maConfirmED.SetPosPixel( aPwdPos2 );
+ maMinLengthFT.SetPosPixel(aPos);
}
Size aBoxSize = maPasswordBox.GetSizePixel();
diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc
index 7c96e131d6..059619a435 100644
--- a/sfx2/source/dialog/passwd.hrc
+++ b/sfx2/source/dialog/passwd.hrc
@@ -36,12 +36,15 @@
#define ED_PASSWD_PASSWORD 14
#define FT_PASSWD_CONFIRM 15
#define ED_PASSWD_CONFIRM 16
+#define FT_PASSWD_MINLEN 17
#define BTN_PASSWD_OK 20
#define BTN_PASSWD_CANCEL 21
#define BTN_PASSWD_HELP 22
#define STR_PASSWD_CONFIRM 30
+#define STR_PASSWD_MIN_LEN 31
+#define STR_PASSWD_EMPTY 32
#endif
diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src
index b95c14cba0..b335bf05a2 100644
--- a/sfx2/source/dialog/passwd.src
+++ b/sfx2/source/dialog/passwd.src
@@ -77,6 +77,22 @@ ModalDialog DLG_PASSWD
Pos = MAP_APPFONT( 57, 44 );
Size = MAP_APPFONT( 75, 12 );
};
+
+ String STR_PASSWD_MIN_LEN
+ {
+ Text [ en-US ] = "(Minimum $(MINLEN) characters)" ;
+ };
+ String STR_PASSWD_EMPTY
+ {
+ Text [ en-US ] = "(The password can be empty)" ;
+ };
+
+ FixedText FT_PASSWD_MINLEN
+ {
+ Pos = MAP_APPFONT(12, 65 );
+ Size = MAP_APPFONT( 126, 10 );
+ };
+
FixedLine GB_PASSWD_PASSWORD
{
Pos = MAP_APPFONT( 6, 3 );