View | Details | Raw Unified | Return to issue 21923
Collapse All | Expand All

(-)sfx2/inc/passwd.hxx (+5 lines)
Lines 74-79 private: Link Here
74
	Edit			maPasswordED;
74
	Edit			maPasswordED;
75
	FixedText		maConfirmFT;
75
	FixedText		maConfirmFT;
76
	Edit			maConfirmED;
76
	Edit			maConfirmED;
77
	FixedText		maMinLengthFT;
77
    FixedLine       maPasswordBox;
78
    FixedLine       maPasswordBox;
78
79
79
	OKButton		maOKBtn;
80
	OKButton		maOKBtn;
Lines 82-93 private: Link Here
82
83
83
	String			maConfirmStr;
84
	String			maConfirmStr;
84
	USHORT			mnMinLen;
85
	USHORT			mnMinLen;
86
	String			maMinLenPwdStr;
87
	String			maEmptyPwdStr;
88
	String			maMainPwdStr;
85
	USHORT			mnExtras;
89
	USHORT			mnExtras;
86
90
87
#if _SOLAR__PRIVATE
91
#if _SOLAR__PRIVATE
88
	DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* );
92
	DECL_DLLPRIVATE_LINK( EditModifyHdl, Edit* );
89
	DECL_DLLPRIVATE_LINK( OKHdl, OKButton* );
93
	DECL_DLLPRIVATE_LINK( OKHdl, OKButton* );
90
#endif
94
#endif
95
	void			SetPasswdText();
91
96
92
public:
97
public:
93
	SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL );
98
	SfxPasswordDialog( Window* pParent, const String* pGroupText = NULL );
(-)sfx2/source/dialog/passwd.cxx (+26 lines)
Lines 98-103 SfxPasswordDialog::SfxPasswordDialog( Wi Link Here
98
	maPasswordED	( this, ResId( ED_PASSWD_PASSWORD ) ),
98
	maPasswordED	( this, ResId( ED_PASSWD_PASSWORD ) ),
99
	maConfirmFT		( this, ResId( FT_PASSWD_CONFIRM ) ),
99
	maConfirmFT		( this, ResId( FT_PASSWD_CONFIRM ) ),
100
	maConfirmED		( this, ResId( ED_PASSWD_CONFIRM ) ),
100
	maConfirmED		( this, ResId( ED_PASSWD_CONFIRM ) ),
101
	maMinLengthFT	( this, ResId( FT_PASSWD_MINLEN ) ),
101
	maPasswordBox	( this, ResId( GB_PASSWD_PASSWORD ) ),
102
	maPasswordBox	( this, ResId( GB_PASSWD_PASSWORD ) ),
102
	maOKBtn			( this, ResId( BTN_PASSWD_OK ) ),
103
	maOKBtn			( this, ResId( BTN_PASSWD_OK ) ),
103
	maCancelBtn		( this, ResId( BTN_PASSWD_CANCEL ) ),
104
	maCancelBtn		( this, ResId( BTN_PASSWD_CANCEL ) ),
Lines 105-110 SfxPasswordDialog::SfxPasswordDialog( Wi Link Here
105
	maConfirmStr	( 		ResId( STR_PASSWD_CONFIRM ) ),
106
	maConfirmStr	( 		ResId( STR_PASSWD_CONFIRM ) ),
106
107
107
	mnMinLen		( 5 ),
108
	mnMinLen		( 5 ),
109
	maMinLenPwdStr	( ResId( STR_PASSWD_MIN_LEN ) ),
110
	maEmptyPwdStr	( ResId( STR_PASSWD_EMPTY ) ),
111
	maMainPwdStr    ( ),
108
	mnExtras		( 0 )
112
	mnExtras		( 0 )
109
113
110
{
114
{
Lines 117-122 SfxPasswordDialog::SfxPasswordDialog( Wi Link Here
117
121
118
	if ( pGroupText )
122
	if ( pGroupText )
119
		  maPasswordBox.SetText( *pGroupText );
123
		  maPasswordBox.SetText( *pGroupText );
124
	
125
//set the text to the pasword length
126
	SetPasswdText();
127
}
128
129
// -----------------------------------------------------------------------
130
131
void SfxPasswordDialog::SetPasswdText( )
132
{
133
//set the new string to the minimum password length
134
	if( mnMinLen == 0 )
135
		maMinLengthFT.SetText( maEmptyPwdStr );
136
	else
137
	{
138
		maMainPwdStr = maMinLenPwdStr;
139
		maMainPwdStr.SearchAndReplace( String::CreateFromAscii( "$(MINLEN)" ), String::CreateFromInt32((sal_Int32) mnMinLen ), 0);
140
		maMinLengthFT.SetText( maMainPwdStr );
141
		maMinLengthFT.Show();
142
	}	
120
}
143
}
121
144
122
// -----------------------------------------------------------------------
145
// -----------------------------------------------------------------------
Lines 124-129 SfxPasswordDialog::SfxPasswordDialog( Wi Link Here
124
void SfxPasswordDialog::SetMinLen( USHORT nLen )
147
void SfxPasswordDialog::SetMinLen( USHORT nLen )
125
{
148
{
126
	mnMinLen = nLen;
149
	mnMinLen = nLen;
150
	SetPasswdText();
127
	EditModifyHdl( NULL );
151
	EditModifyHdl( NULL );
128
}
152
}
129
153
Lines 174-181 short SfxPasswordDialog::Execute() Link Here
174
			aPos = maUserED.GetPosPixel();
198
			aPos = maUserED.GetPosPixel();
175
			maPasswordED.SetPosPixel( aPos );
199
			maPasswordED.SetPosPixel( aPos );
176
200
201
			aPos = maConfirmFT.GetPosPixel();
177
			maConfirmFT.SetPosPixel( aPwdPos1 );
202
			maConfirmFT.SetPosPixel( aPwdPos1 );
178
			maConfirmED.SetPosPixel( aPwdPos2 );
203
			maConfirmED.SetPosPixel( aPwdPos2 );
204
			maMinLengthFT.SetPosPixel(aPos);
179
		}
205
		}
180
206
181
		Size aBoxSize = maPasswordBox.GetSizePixel();
207
		Size aBoxSize = maPasswordBox.GetSizePixel();
(-)sfx2/source/dialog/passwd.hrc (+3 lines)
Lines 44-55 Link Here
44
#define ED_PASSWD_PASSWORD 14
44
#define ED_PASSWD_PASSWORD 14
45
#define FT_PASSWD_CONFIRM 15
45
#define FT_PASSWD_CONFIRM 15
46
#define ED_PASSWD_CONFIRM 16
46
#define ED_PASSWD_CONFIRM 16
47
#define FT_PASSWD_MINLEN 17
47
48
48
#define BTN_PASSWD_OK 20
49
#define BTN_PASSWD_OK 20
49
#define BTN_PASSWD_CANCEL 21
50
#define BTN_PASSWD_CANCEL 21
50
#define BTN_PASSWD_HELP 22
51
#define BTN_PASSWD_HELP 22
51
52
52
#define STR_PASSWD_CONFIRM 30
53
#define STR_PASSWD_CONFIRM 30
54
#define STR_PASSWD_MIN_LEN	31
55
#define STR_PASSWD_EMPTY	32
53
56
54
#endif
57
#endif
55
58
(-)sfx2/source/dialog/passwd.src (+16 lines)
Lines 91-96 ModalDialog DLG_PASSWD Link Here
91
		Pos = MAP_APPFONT( 57, 44 );
91
		Pos = MAP_APPFONT( 57, 44 );
92
		Size = MAP_APPFONT( 75, 12 );
92
		Size = MAP_APPFONT( 75, 12 );
93
	};
93
	};
94
	
95
	String STR_PASSWD_MIN_LEN
96
	{
97
		Text [ en-US ] = "(Minimum $(MINLEN) characters)" ;
98
	};
99
	String STR_PASSWD_EMPTY
100
	{
101
		Text [ en-US ] = "(The password can be empty)" ;
102
	};
103
	
104
	FixedText FT_PASSWD_MINLEN
105
	{
106
		Pos = MAP_APPFONT(12, 65 );
107
		Size = MAP_APPFONT( 126, 10 );
108
	};
109
	
94
    FixedLine GB_PASSWD_PASSWORD
110
    FixedLine GB_PASSWD_PASSWORD
95
	{
111
	{
96
		Pos = MAP_APPFONT( 6, 3 );
112
		Pos = MAP_APPFONT( 6, 3 );

Return to issue 21923