summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/passwd.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/dialog/passwd.cxx')
-rw-r--r--sfx2/source/dialog/passwd.cxx26
1 files changed, 26 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();