update dev300-m58
[ooovba.git] / applied_patches / 0119-sc-save-password-minlength.diff
blobfb894359290673b6cf884db4a6a5560467877945
1 --- sfx2/inc/sfx2/passwd.hxx.orig 2007-08-30 13:37:21.000000000 -0400
2 +++ sfx2/inc/sfx2/passwd.hxx 2007-08-30 15:00:41.000000000 -0400
3 @@ -74,6 +74,7 @@
4 Edit maPasswordED;
5 FixedText maConfirmFT;
6 Edit maConfirmED;
7 + FixedText maMinLengthFT;
8 FixedLine maPasswordBox;
10 OKButton maOKBtn;
11 @@ -82,12 +83,16 @@
13 String maConfirmStr;
14 USHORT mnMinLen;
15 + String maMinLenPwdStr;
16 + String maEmptyPwdStr;
17 + String maMainPwdStr;
18 USHORT mnExtras;
20 //#if 0 // _SOLAR__PRIVATE
21 DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* );
22 DECL_DLLPRIVATE_LINK( OKHdl, OKButton* );
23 //#endif
24 + void SetPasswdText();
26 public:
27 SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL );
28 --- sfx2/source/dialog/passwd.cxx.orig 2007-08-30 13:37:07.000000000 -0400
29 +++ sfx2/source/dialog/passwd.cxx 2007-08-30 14:05:12.000000000 -0400
30 @@ -100,6 +100,7 @@
31 maPasswordED ( this, SfxResId( ED_PASSWD_PASSWORD ) ),
32 maConfirmFT ( this, SfxResId( FT_PASSWD_CONFIRM ) ),
33 maConfirmED ( this, SfxResId( ED_PASSWD_CONFIRM ) ),
34 + maMinLengthFT ( this, SfxResId( FT_PASSWD_MINLEN ) ),
35 maPasswordBox ( this, SfxResId( GB_PASSWD_PASSWORD ) ),
36 maOKBtn ( this, SfxResId( BTN_PASSWD_OK ) ),
37 maCancelBtn ( this, SfxResId( BTN_PASSWD_CANCEL ) ),
38 @@ -107,6 +108,9 @@
39 maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ),
41 mnMinLen ( 5 ),
42 + maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ) ),
43 + maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ) ),
44 + maMainPwdStr ( ),
45 mnExtras ( 0 )
48 @@ -119,6 +123,25 @@
50 if ( pGroupText )
51 maPasswordBox.SetText( *pGroupText );
53 +//set the text to the pasword length
54 + SetPasswdText();
57 +// -----------------------------------------------------------------------
59 +void SfxPasswordDialog::SetPasswdText( )
61 +//set the new string to the minimum password length
62 + if( mnMinLen == 0 )
63 + maMinLengthFT.SetText( maEmptyPwdStr );
64 + else
65 + {
66 + maMainPwdStr = maMinLenPwdStr;
67 + maMainPwdStr.SearchAndReplace( String::CreateFromAscii( "$(MINLEN)" ), String::CreateFromInt32((sal_Int32) mnMinLen ), 0);
68 + maMinLengthFT.SetText( maMainPwdStr );
69 + maMinLengthFT.Show();
70 + }
73 // -----------------------------------------------------------------------
74 @@ -126,6 +149,7 @@
75 void SfxPasswordDialog::SetMinLen( USHORT nLen )
77 mnMinLen = nLen;
78 + SetPasswdText();
79 EditModifyHdl( NULL );
82 @@ -176,8 +200,10 @@
83 aPos = maUserED.GetPosPixel();
84 maPasswordED.SetPosPixel( aPos );
86 + aPos = maConfirmFT.GetPosPixel();
87 maConfirmFT.SetPosPixel( aPwdPos1 );
88 maConfirmED.SetPosPixel( aPwdPos2 );
89 + maMinLengthFT.SetPosPixel(aPos);
92 Size aBoxSize = maPasswordBox.GetSizePixel();
93 ===================================================================
94 RCS file: /cvs/framework/sfx2/source/dialog/passwd.hrc,v
95 retrieving revision 1.2
96 diff -u -p -u -r1.2 passwd.hrc
97 --- sfx2/source/dialog/passwd.hrc 7 Sep 2005 18:28:36 -0000 1.2
98 +++ sfx2/source/dialog/passwd.hrc 29 Jul 2006 11:50:09 -0000
99 @@ -44,12 +44,15 @@
100 #define ED_PASSWD_PASSWORD 14
101 #define FT_PASSWD_CONFIRM 15
102 #define ED_PASSWD_CONFIRM 16
103 +#define FT_PASSWD_MINLEN 17
105 #define BTN_PASSWD_OK 20
106 #define BTN_PASSWD_CANCEL 21
107 #define BTN_PASSWD_HELP 22
109 #define STR_PASSWD_CONFIRM 30
110 +#define STR_PASSWD_MIN_LEN 31
111 +#define STR_PASSWD_EMPTY 32
113 #endif
115 Index: sfx2/source/dialog/passwd.src
116 ===================================================================
117 RCS file: /cvs/framework/sfx2/source/dialog/passwd.src,v
118 retrieving revision 1.27
119 diff -u -p -u -r1.27 passwd.src
120 --- sfx2/source/dialog/passwd.src 23 Sep 2005 15:25:58 -0000 1.27
121 +++ sfx2/source/dialog/passwd.src 29 Jul 2006 11:50:09 -0000
122 @@ -91,6 +91,22 @@ ModalDialog DLG_PASSWD
123 Pos = MAP_APPFONT( 57, 44 );
124 Size = MAP_APPFONT( 75, 12 );
127 + String STR_PASSWD_MIN_LEN
129 + Text [ en-US ] = "(Minimum $(MINLEN) characters)" ;
130 + };
131 + String STR_PASSWD_EMPTY
133 + Text [ en-US ] = "(The password can be empty)" ;
134 + };
136 + FixedText FT_PASSWD_MINLEN
138 + Pos = MAP_APPFONT(12, 65 );
139 + Size = MAP_APPFONT( 126, 10 );
140 + };
142 FixedLine GB_PASSWD_PASSWORD
144 Pos = MAP_APPFONT( 6, 3 );