masterfix DEV300: #i10000# build fix
[LibreOffice.git] / cui / source / options / optgenrl.cxx
blobbba3b10fc846aa105c5cabf257e3216d54196ad5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cui.hxx"
31 // include ---------------------------------------------------------------
32 #include <tools/shl.hxx>
33 #include <vcl/svapp.hxx>
34 #include <vcl/msgbox.hxx>
35 #include <unotools/saveopt.hxx>
36 #include <svl/intitem.hxx>
38 #define _SVX_OPTGENRL_CXX
40 #include <cuires.hrc>
41 #include "optgenrl.hrc"
42 #include <unotools/useroptions.hxx>
43 #include "cuioptgenrl.hxx"
44 #include <dialmgr.hxx>
45 #include <svx/dlgutil.hxx>
46 #include <svx/strarray.hxx>
47 #include <svx/svxids.hrc> // SID_FIELD_GRABFOCUS
49 #define TRIM(s) s.EraseLeadingChars().EraseTrailingChars()
51 // struct GeneralTabPage_Impl --------------------------------------------
53 struct GeneralTabPage_Impl
55 sal_Bool mbStreetEnabled;
56 sal_Bool mbPLZEnabled;
57 sal_Bool mbCityEnabled;
58 sal_Bool mbUsCityEnabled;
59 sal_Bool mbUsZipEnabled;
61 String maQueryStr;
63 GeneralTabPage_Impl() :
64 mbStreetEnabled ( sal_False ),
65 mbPLZEnabled ( sal_False ),
66 mbCityEnabled ( sal_False ),
67 mbUsCityEnabled ( sal_False ),
68 mbUsZipEnabled ( sal_False ) {}
71 // -----------------------------------------------------------------------
73 SvxGeneralTabPage::SvxGeneralTabPage( Window* pParent, const SfxItemSet& rCoreSet ) :
75 SfxTabPage( pParent, CUI_RES(RID_SFXPAGE_GENERAL), rCoreSet ),
77 aAddrFrm ( this, CUI_RES( GB_ADDRESS ) ),
78 aCompanyLbl ( this, CUI_RES( FT_COMPANY ), true ),
79 aCompanyEdit ( this, CUI_RES( ED_COMPANY ), INDEX_NOTSET, &aCompanyLbl ),
80 aNameLbl ( this, CUI_RES( FT_NAME ), true ),
81 aNameLblRuss ( this, CUI_RES( FT_NAME_RUSS ), true ),
82 aNameLblEastern ( this, CUI_RES( FT_NAME_EASTERN ), true ),
83 aFirstName ( this, CUI_RES( ED_FIRSTNAME ), 0, &aNameLbl ),
84 aFatherName ( this, CUI_RES( ED_FATHERNAME ) ),
85 aName ( this, CUI_RES( ED_NAME ), 1, &aNameLbl ),
86 aShortName ( this, CUI_RES( ED_SHORTNAME ), 2, &aNameLbl ),
87 aStreetLbl ( this, CUI_RES( FT_STREET ), true ),
88 aStreetLblRuss ( this, CUI_RES( FT_STREET_RUSS ), true ),
89 aStreetEdit ( this, CUI_RES( ED_STREET ), 0, &aStreetLbl ),
90 aApartmentNrEdit( this, CUI_RES( ED_APARTMENTNR ), 1, &aStreetLblRuss ),
91 aCityLbl ( this, CUI_RES( FT_CITY ), true ),
92 aPLZEdit ( this, CUI_RES( ED_PLZ ), 0, &aCityLbl ),
93 aCityEdit ( this, CUI_RES( ED_CITY ), 1, &aCityLbl ),
94 aUsCityEdit ( this, CUI_RES( ED_US_CITY ), 0, &aCityLbl ),
95 aUsStateEdit ( this, CUI_RES( ED_US_STATE ), 1, &aCityLbl ),
96 aUsZipEdit ( this, CUI_RES( ED_US_ZIPCODE ), 2, &aCityLbl ),
97 aCountryLbl ( this, CUI_RES( FT_COUNTRY ), true ),
98 aCountryEdit ( this, CUI_RES( ED_COUNTRY ), INDEX_NOTSET, &aCountryLbl ),
99 aTitlePosLbl ( this, CUI_RES( FT_TITLEPOS ), true ),
100 aTitleEdit ( this, CUI_RES( ED_TITLE ), 0, &aTitlePosLbl ),
101 aPositionEdit ( this, CUI_RES( ED_POSITION ), 1, &aTitlePosLbl ),
102 aPhoneLbl ( this, CUI_RES( FT_PHONE ), true ),
103 aTelPrivEdit ( this, CUI_RES( ED_TELPRIVAT ), 0, &aPhoneLbl ),
104 aTelCompanyEdit ( this, CUI_RES( ED_TELCOMPANY ), 1, &aPhoneLbl ),
105 aFaxMailLbl ( this, CUI_RES( FT_FAXMAIL ), true ),
106 aFaxEdit ( this, CUI_RES( ED_FAX ), 0, &aFaxMailLbl ),
107 aEmailEdit ( this, CUI_RES( ED_EMAIL ), 1, &aFaxMailLbl ),
108 aUseDataCB ( this, CUI_RES( CB_USEDATA ) ),
109 pImpl ( new GeneralTabPage_Impl )
112 LanguageType eLang = Application::GetSettings().GetUILanguage();
113 pImpl->maQueryStr = String( CUI_RES( STR_QUERY_REG ) );
115 if ( LANGUAGE_ENGLISH_US == eLang )
117 // amerikanische Postadresse aufbauen
118 aPLZEdit.Hide();
119 aCityEdit.Hide();
120 aCityLbl.SetText( CUI_RES( STR_US_STATE ) );
122 else if ( LANGUAGE_RUSSIAN == eLang )
124 aUsCityEdit.Hide();
125 aUsStateEdit.Hide();
126 aUsZipEdit.Hide();
127 aNameLbl.Hide();
128 aNameLblRuss.Show();
129 aStreetLbl.Hide();
130 aStreetLblRuss.Show();
131 aFatherName.Show();
132 aName.SetIndex( 0 );
133 aName.SetLabel( &aNameLblRuss );
134 aFirstName.SetIndex( 1 );
135 aFirstName.SetLabel( &aNameLblRuss );
136 aFatherName.SetIndex( 2 );
137 aFatherName.SetLabel( &aNameLblRuss );
138 aShortName.SetIndex( 3 );
139 aShortName.SetLabel( &aNameLblRuss );
141 Point aEditPoint = LogicToPixel( Point( MID, LINE(1) ), MAP_APPFONT );
142 Point aRightPoint = LogicToPixel( Point( RIGHT, LINE(1) ), MAP_APPFONT );
143 Size aEditSize = LogicToPixel( Size( 42, 12 ), MAP_APPFONT );
144 Size a2Size = LogicToPixel( Size( 2, 2 ), MAP_APPFONT );
145 long nDelta = aEditSize.Width() + a2Size.Width();
146 aName.SetPosSizePixel( aEditPoint, aEditSize );
147 aEditPoint.X() = aEditPoint.X() + nDelta;
148 aFirstName.SetPosSizePixel( aEditPoint, aEditSize );
149 aEditPoint.X() = aEditPoint.X() + nDelta;
150 aFatherName.SetPosSizePixel( aEditPoint, aEditSize );
151 aEditPoint.X() = aEditPoint.X() + nDelta;
152 aEditSize.Width() = aRightPoint.X() - aEditPoint.X();
153 aShortName.SetPosSizePixel( aEditPoint, aEditSize );
155 Size aStreetSize = aStreetEdit.GetSizePixel();
156 aStreetSize.Width() = aStreetSize.Width() - aEditSize.Width() - a2Size.Width();
157 aStreetEdit.SetSizePixel( aStreetSize );
158 aApartmentNrEdit.Show();
159 Point aApartmentPoint = LogicToPixel( Point( MID, LINE(2) ), MAP_APPFONT );
160 aApartmentPoint.X() = aEditPoint.X();
161 aApartmentNrEdit.SetPosSizePixel( aApartmentPoint, aEditSize );
163 aName.SetZOrder( &aNameLblRuss, WINDOW_ZORDER_BEHIND );
164 aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND );
165 aFatherName.SetZOrder( &aFirstName, WINDOW_ZORDER_BEHIND );
167 else if ( LANGUAGE_JAPANESE == eLang ||
168 LANGUAGE_KOREAN == eLang ||
169 LANGUAGE_CHINESE_TRADITIONAL == eLang ||
170 LANGUAGE_CHINESE_SIMPLIFIED == eLang)
172 aUsCityEdit.Hide();
173 aUsStateEdit.Hide();
174 aUsZipEdit.Hide();
175 aNameLbl.Hide();
176 aNameLblEastern.Show();
178 // swap "first name" field and "last name" field
179 Point aPosTmp = aFirstName.GetPosPixel();
180 aFirstName.SetPosPixel( aName.GetPosPixel() );
181 aName.SetPosPixel( aPosTmp );
182 aFirstName.SetZOrder( &aName, WINDOW_ZORDER_BEHIND );
184 else
186 aUsCityEdit.Hide();
187 aUsStateEdit.Hide();
188 aUsZipEdit.Hide();
191 FreeResource();
193 // diese Page braucht ExchangeSupport
194 SetExchangeSupport();
196 Link aLink = LINK( this, SvxGeneralTabPage, ModifyHdl_Impl );
197 aFirstName.SetModifyHdl( aLink );
198 aName.SetModifyHdl( aLink );
200 // because some labels have text for more than one edit field we have to split these texts
201 // and set these texts as accessible name of the corresponding edit fields
202 SvxUserEdit* pEdits[] =
204 &aCompanyEdit, &aFirstName, &aFatherName, &aName, &aShortName, &aStreetEdit,
205 &aApartmentNrEdit, &aPLZEdit, &aCityEdit, &aUsCityEdit, &aUsStateEdit, &aUsZipEdit,
206 &aCountryEdit, &aTitleEdit, &aPositionEdit, &aTelPrivEdit, &aTelCompanyEdit,
207 &aFaxEdit, &aEmailEdit, NULL
209 SvxUserEdit** pCurrent = pEdits;
210 while ( *pCurrent )
212 Window* pLabel = (*pCurrent)->GetLabel();
213 if ( pLabel )
215 String sName, sText = pLabel->GetDisplayText();
216 sal_Int16 nIndex = (*pCurrent)->GetIndex();
217 if ( INDEX_NOTSET == nIndex )
218 sName = sText;
219 else
220 sName = sText.GetToken( nIndex, '/' );
221 sName.EraseAllChars( '(' );
222 sName.EraseAllChars( ')' );
223 if ( sName.Len() > 0 )
224 (*pCurrent)->SetAccessibleName( sName );
226 pCurrent++;
230 //------------------------------------------------------------------------
232 SvxGeneralTabPage::~SvxGeneralTabPage()
234 delete pImpl;
237 //------------------------------------------------------------------------
239 SfxTabPage* SvxGeneralTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
241 return ( new SvxGeneralTabPage( pParent, rAttrSet ) );
244 //------------------------------------------------------------------------
246 sal_Bool SvxGeneralTabPage::FillItemSet( SfxItemSet& )
248 // Eingaben trimmen (f"uhrende und nachfolgende Leerzeichen entfernen)
249 aCompanyEdit.SetText( TRIM(aCompanyEdit.GetText()) );
250 aFirstName.SetText( TRIM(aFirstName.GetText()) );
251 aName.SetText( TRIM(aName.GetText()) );
252 aShortName.SetText( TRIM(aShortName.GetText()) );
253 aStreetEdit.SetText( TRIM(aStreetEdit.GetText()) );
254 aCountryEdit.SetText( TRIM(aCountryEdit.GetText()) );
255 aPLZEdit.SetText( TRIM(aPLZEdit.GetText()) );
256 aCityEdit.SetText( TRIM(aCityEdit.GetText()) );
257 aUsCityEdit.SetText( TRIM(aUsCityEdit.GetText()) );
258 aUsStateEdit.SetText( TRIM(aUsStateEdit.GetText()) );
259 aUsZipEdit.SetText( TRIM(aUsZipEdit.GetText()) );
260 aTitleEdit.SetText( TRIM(aTitleEdit.GetText()) );
261 aPositionEdit.SetText( TRIM(aPositionEdit.GetText()) );
262 aTelPrivEdit.SetText( TRIM(aTelPrivEdit.GetText()) );
263 aTelCompanyEdit.SetText( TRIM(aTelCompanyEdit.GetText()) );
264 aFaxEdit.SetText( TRIM(aFaxEdit.GetText()) );
265 aEmailEdit.SetText( TRIM(aEmailEdit.GetText()) );
267 sal_Bool bModified = sal_False;
268 bModified |= GetAddress_Impl();
269 SvtSaveOptions aSaveOpt;
270 if ( aUseDataCB.IsChecked() != aSaveOpt.IsUseUserData() )
272 aSaveOpt.SetUseUserData( aUseDataCB.IsChecked() );
273 bModified |= sal_True;
275 return bModified;
278 //------------------------------------------------------------------------
280 void SvxGeneralTabPage::Reset( const SfxItemSet& rSet )
282 SetAddress_Impl();
284 sal_uInt16 nWhich = GetWhich( SID_FIELD_GRABFOCUS );
285 if ( rSet.GetItemState( nWhich ) == SFX_ITEM_SET )
287 sal_uInt16 nField = ( (SfxUInt16Item&)rSet.Get( nWhich ) ).GetValue();
289 switch ( nField )
291 case COMPANY_EDIT: aCompanyEdit.GrabFocus(); break;
292 case FIRSTNAME_EDIT: aFirstName.GrabFocus(); break;
293 case LASTNAME_EDIT: aName.GrabFocus(); break;
294 case STREET_EDIT: aStreetEdit.GrabFocus(); break;
295 case COUNTRY_EDIT: aCountryEdit.GrabFocus(); break;
296 case PLZ_EDIT:
297 if ( aPLZEdit.IsVisible() )
298 aPLZEdit.GrabFocus();
299 else
300 aUsZipEdit.GrabFocus();
301 break;
302 case CITY_EDIT:
303 if ( aCityEdit.IsVisible() )
304 aCityEdit.GrabFocus();
305 else
306 aUsCityEdit.GrabFocus();
307 break;
308 case STATE_EDIT:
309 if ( aUsStateEdit.IsVisible() )
310 aUsStateEdit.GrabFocus();
311 else
312 aCityEdit.GrabFocus();
313 break;
314 case TITLE_EDIT: aTitleEdit.GrabFocus(); break;
315 case POSITION_EDIT: aPositionEdit.GrabFocus(); break;
316 case SHORTNAME_EDIT: aShortName.GrabFocus(); break;
317 case TELPRIV_EDIT: aTelPrivEdit.GrabFocus(); break;
318 case TELCOMPANY_EDIT: aTelCompanyEdit.GrabFocus(); break;
319 case FAX_EDIT: aFaxEdit.GrabFocus(); break;
320 case EMAIL_EDIT: aEmailEdit.GrabFocus(); break;
321 default: aCompanyEdit.GrabFocus();
325 aUseDataCB.Check( SvtSaveOptions().IsUseUserData() );
328 //------------------------------------------------------------------------
330 IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit )
332 if ( aShortName.IsEnabled() )
334 String aShortStr( aShortName.GetText() );
335 switch ( aShortStr.Len() )
337 case 0:
338 aShortStr = String( RTL_CONSTASCII_STRINGPARAM(" ") );
339 break;
341 case 1:
342 aShortStr += ' ';
343 break;
346 sal_uInt16 nPos = ( pEdit == &aFirstName ) ? 0 : 1;
347 String aTxt = pEdit->GetText();
348 sal_Unicode cChar = ( aTxt.Len() > 0 ) ? aTxt.GetChar(0) : ' ';
349 aShortStr.SetChar( nPos, cChar );
350 aShortStr.EraseTrailingChars();
351 aShortName.SetText( aShortStr );
353 return 0;
356 //------------------------------------------------------------------------
358 sal_Bool SvxGeneralTabPage::GetAddress_Impl()
360 sal_Bool bRet =
361 ( aCompanyEdit.GetSavedValue() != aCompanyEdit.GetText() ||
362 aFirstName.GetSavedValue() != aFirstName.GetText() ||
363 aFatherName.GetSavedValue() != aFatherName.GetText() ||
364 aName.GetSavedValue() != aName.GetText() ||
365 aShortName.GetSavedValue() != aShortName.GetText() ||
366 aStreetEdit.GetSavedValue() != aStreetEdit.GetText() ||
367 aApartmentNrEdit.GetSavedValue() != aApartmentNrEdit.GetText() ||
368 aPLZEdit.GetSavedValue() != aPLZEdit.GetText() ||
369 aCityEdit.GetSavedValue() != aCityEdit.GetText() ||
370 aUsCityEdit.GetSavedValue() != aUsCityEdit.GetText() ||
371 aUsStateEdit.GetSavedValue() != aUsStateEdit.GetText() ||
372 aUsZipEdit.GetSavedValue() != aUsZipEdit.GetText() ||
373 aCountryEdit.GetSavedValue() != aCountryEdit.GetText() ||
374 aTitleEdit.GetSavedValue() != aTitleEdit.GetText() ||
375 aPositionEdit.GetSavedValue() != aPositionEdit.GetText() ||
376 aTelPrivEdit.GetSavedValue() != aTelPrivEdit.GetText() ||
377 aTelCompanyEdit.GetSavedValue() != aTelCompanyEdit.GetText() ||
378 aFaxEdit.GetSavedValue() != aFaxEdit.GetText() ||
379 aEmailEdit.GetSavedValue() != aEmailEdit.GetText() );
381 LanguageType eLang = Application::GetSettings().GetUILanguage();
382 sal_Bool bUS = ( LANGUAGE_ENGLISH_US == eLang );
384 SvtUserOptions aUserOpt;
385 aUserOpt.SetCompany(aCompanyEdit.GetText());
386 aUserOpt.SetFirstName(aFirstName.GetText());
387 aUserOpt.SetLastName(aName.GetText());
388 aUserOpt.SetID( aShortName.GetText());
390 aUserOpt.SetStreet(aStreetEdit.GetText() );
392 aUserOpt.SetCountry(aCountryEdit.GetText() );
394 aUserOpt.SetZip(bUS ? aUsZipEdit.GetText() : aPLZEdit.GetText() );
395 aUserOpt.SetCity(bUS ? aUsCityEdit.GetText() : aCityEdit.GetText() );
397 aUserOpt.SetTitle( aTitleEdit.GetText() );
398 aUserOpt.SetPosition(aPositionEdit.GetText() );
399 aUserOpt.SetTelephoneHome( aTelPrivEdit.GetText() );
400 aUserOpt.SetTelephoneWork( aTelCompanyEdit.GetText() );
401 aUserOpt.SetFax( aFaxEdit.GetText() );
402 aUserOpt.SetEmail( aEmailEdit.GetText() );
403 aUserOpt.SetState( bUS ? aUsStateEdit.GetText() : String() );
405 if ( LANGUAGE_RUSSIAN == eLang )
407 aUserOpt.SetFathersName( aFatherName.GetText() );
408 aUserOpt.SetApartment( aApartmentNrEdit.GetText() );
410 return bRet;
413 //------------------------------------------------------------------------
415 void SvxGeneralTabPage::SetAddress_Impl()
417 LanguageType eLang = Application::GetSettings().GetUILanguage();
418 sal_Bool bUS = ( LANGUAGE_ENGLISH_US == eLang );
419 SvtUserOptions aUserOpt;
420 aCompanyEdit.SetText( aUserOpt.GetCompany() );
421 if ( aUserOpt.IsTokenReadonly( USER_OPT_COMPANY ) )
423 aCompanyLbl.Disable();
424 aCompanyEdit.Disable();
426 sal_Int16 nEditCount = 0;
427 aFirstName.SetText( aUserOpt.GetFirstName() );
428 if ( aUserOpt.IsTokenReadonly( USER_OPT_FIRSTNAME ) )
430 aFirstName.Disable();
431 nEditCount++;
433 aName.SetText( aUserOpt.GetLastName() );
434 if ( aUserOpt.IsTokenReadonly( USER_OPT_LASTNAME ) )
436 aName.Disable();
437 nEditCount++;
439 aShortName.SetText( aUserOpt.GetID() );
440 if ( aUserOpt.IsTokenReadonly( USER_OPT_ID ) )
442 aShortName.Disable();
443 nEditCount++;
445 aNameLbl.Enable( ( nEditCount != 3 ) );
446 aStreetEdit.SetText( aUserOpt.GetStreet() );
447 if ( aUserOpt.IsTokenReadonly( USER_OPT_STREET ) )
449 aStreetLbl.Disable();
450 aStreetEdit.Disable();
452 Edit* pPLZEdit = bUS ? &aUsZipEdit : &aPLZEdit;
453 Edit* pCityEdit = bUS ? &aUsCityEdit : &aCityEdit;
454 pPLZEdit->SetText( aUserOpt.GetZip() );
455 pCityEdit->SetText( aUserOpt.GetCity() );
456 nEditCount = 0;
457 if ( aUserOpt.IsTokenReadonly( USER_OPT_ZIP ) )
459 pPLZEdit->Disable();
460 nEditCount++;
462 if ( aUserOpt.IsTokenReadonly( USER_OPT_CITY ) )
464 pCityEdit->Disable();
465 nEditCount++;
467 if ( bUS )
469 aUsStateEdit.SetText( aUserOpt.GetState() );
470 if ( aUserOpt.IsTokenReadonly( USER_OPT_STATE ) )
472 aUsStateEdit.Disable();
473 nEditCount++;
476 aCityLbl.Enable( ( nEditCount != ( bUS ? 3 : 2 ) ) );
477 aCountryEdit.SetText( aUserOpt.GetCountry() );
478 if ( aUserOpt.IsTokenReadonly( USER_OPT_COUNTRY ) )
480 aCountryLbl.Disable();
481 aCountryEdit.Disable();
483 aTitleEdit.SetText( aUserOpt.GetTitle() );
484 aPositionEdit.SetText( aUserOpt.GetPosition() );
485 nEditCount = 0;
486 if ( aUserOpt.IsTokenReadonly( USER_OPT_TITLE ) )
488 aTitleEdit.Disable();
489 nEditCount++;
491 if ( aUserOpt.IsTokenReadonly( USER_OPT_POSITION ) )
493 aPositionEdit.Disable();
494 nEditCount++;
496 aTitlePosLbl.Enable( ( nEditCount != 2 ) );
497 aTelPrivEdit.SetText( aUserOpt.GetTelephoneHome() );
498 aTelCompanyEdit.SetText( aUserOpt.GetTelephoneWork() );
499 nEditCount = 0;
500 if ( aUserOpt.IsTokenReadonly( USER_OPT_TELEPHONEHOME ) )
502 aTelPrivEdit.Disable();
503 nEditCount++;
505 if ( aUserOpt.IsTokenReadonly( USER_OPT_TELEPHONEWORK ) )
507 aTelCompanyEdit.Disable();
508 nEditCount++;
510 aPhoneLbl.Enable( ( nEditCount != 2 ) );
511 aFaxEdit.SetText( aUserOpt.GetFax() );
512 aEmailEdit.SetText( aUserOpt.GetEmail() );
513 nEditCount = 0;
514 if ( aUserOpt.IsTokenReadonly( USER_OPT_FAX ) )
516 aFaxEdit.Disable();
517 nEditCount++;
519 if ( aUserOpt.IsTokenReadonly( USER_OPT_EMAIL ) )
521 aEmailEdit.Disable();
522 nEditCount++;
524 aFaxMailLbl.Enable( ( nEditCount != 2 ) );
526 if ( LANGUAGE_RUSSIAN == eLang )
528 aFatherName.SetText( aUserOpt.GetFathersName() );
529 aApartmentNrEdit.SetText( aUserOpt.GetApartment() );
532 aCompanyEdit.SaveValue();
533 aFirstName.SaveValue();
534 aFatherName.SaveValue();
535 aName.SaveValue();
536 aShortName.SaveValue();
537 aStreetEdit.SaveValue();
538 aApartmentNrEdit.SaveValue();
539 aPLZEdit.SaveValue();
540 aCityEdit.SaveValue();
541 aUsCityEdit.SaveValue();
542 aUsStateEdit.SaveValue();
543 aUsZipEdit.SaveValue();
544 aCountryEdit.SaveValue();
545 aTitleEdit.SaveValue();
546 aPositionEdit.SaveValue();
547 aTelPrivEdit.SaveValue();
548 aTelCompanyEdit.SaveValue();
549 aFaxEdit.SaveValue();
550 aEmailEdit.SaveValue();
553 // -----------------------------------------------------------------------
555 int SvxGeneralTabPage::DeactivatePage( SfxItemSet* _pSet )
557 if ( _pSet )
558 FillItemSet( *_pSet );
559 return LEAVE_PAGE;