1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_desktop.hxx"
30 
31 #include <migration.hxx>
32 #include "wizard.hxx"
33 #include "wizard.hrc"
34 #include "pages.hxx"
35 #include "app.hxx"
36 
37 #include <rtl/ustring.hxx>
38 #include <rtl/ustrbuf.hxx>
39 #include <rtl/string.hxx>
40 #include <rtl/strbuf.hxx>
41 #include <rtl/bootstrap.hxx>
42 
43 #include <comphelper/processfactory.hxx>
44 #include <tools/date.hxx>
45 #include <tools/time.hxx>
46 #include <tools/datetime.hxx>
47 #include <osl/file.hxx>
48 #include <osl/time.h>
49 #include <osl/module.hxx>
50 #include <unotools/bootstrap.hxx>
51 #include <vcl/msgbox.hxx>
52 
53 #include <com/sun/star/uno/Any.hxx>
54 #include <com/sun/star/uno/Sequence.hxx>
55 #include <com/sun/star/beans/NamedValue.hpp>
56 #include <com/sun/star/beans/XPropertySet.hpp>
57 #include <com/sun/star/beans/XPropertyState.hpp>
58 #include <com/sun/star/frame/XDesktop.hpp>
59 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
60 #include <com/sun/star/lang/XInitialization.hpp>
61 #include <com/sun/star/lang/XComponent.hpp>
62 #include <com/sun/star/util/XChangesBatch.hpp>
63 #include <com/sun/star/container/XNameReplace.hpp>
64 #include <com/sun/star/awt/WindowDescriptor.hpp>
65 #include <com/sun/star/awt/WindowAttribute.hpp>
66 
67 using namespace svt;
68 using namespace rtl;
69 using namespace osl;
70 using namespace utl;
71 using namespace com::sun::star;
72 using namespace com::sun::star::uno;
73 using namespace com::sun::star::lang;
74 using namespace com::sun::star::beans;
75 using namespace com::sun::star::util;
76 using namespace com::sun::star::container;
77 
78 #define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
79 
80 namespace desktop
81 {
82 
83 const FirstStartWizard::WizardState FirstStartWizard::STATE_WELCOME      = 0;
84 const FirstStartWizard::WizardState FirstStartWizard::STATE_LICENSE      = 1;
85 const FirstStartWizard::WizardState FirstStartWizard::STATE_MIGRATION    = 2;
86 const FirstStartWizard::WizardState FirstStartWizard::STATE_USER         = 3;
87 const FirstStartWizard::WizardState FirstStartWizard::STATE_UPDATE_CHECK = 4;
88 const FirstStartWizard::WizardState FirstStartWizard::STATE_REGISTRATION = 5;
89 
90 static sal_Int32 getBuildId()
91 {
92     ::rtl::OUString aDefault;
93     ::rtl::OUString aBuildIdData = utl::Bootstrap::getBuildIdData( aDefault );
94     sal_Int32 nBuildId( 0 );
95     sal_Int32 nIndex1 = aBuildIdData.indexOf(':');
96     sal_Int32 nIndex2 = aBuildIdData.indexOf(')');
97     if (( nIndex1 > 0 ) && ( nIndex2 > 0 ) && ( nIndex2-1 > nIndex1+1 ))
98     {
99         ::rtl::OUString aBuildId = aBuildIdData.copy( nIndex1+1, nIndex2-nIndex1-1 );
100         nBuildId = aBuildId.toInt32();
101     }
102     return nBuildId;
103 }
104 
105 WizardResId::WizardResId( sal_uInt16 nId ) :
106 	ResId( nId, *FirstStartWizard::GetResManager() )
107 {
108 }
109 
110 ResMgr *FirstStartWizard::pResMgr = 0;
111 
112 ResMgr *FirstStartWizard::GetResManager()
113 {
114     if ( !FirstStartWizard::pResMgr )
115     {
116         String aMgrName = String::CreateFromAscii( "dkt" );
117         FirstStartWizard::pResMgr = ResMgr::CreateResMgr( OUStringToOString( aMgrName, RTL_TEXTENCODING_UTF8 ));
118     }
119     return FirstStartWizard::pResMgr;
120 }
121 
122 FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAcceptance, const rtl::OUString &rLicensePath )
123     :RoadmapWizard( pParent, WizardResId(DLG_FIRSTSTART_WIZARD),
124         WZB_NEXT|WZB_PREVIOUS|WZB_FINISH|WZB_CANCEL|WZB_HELP)
125     ,m_bOverride(sal_False)
126     ,m_aDefaultPath(0)
127 	,m_aMigrationPath(0)
128     ,m_bDone(sal_False)
129 	,m_bLicenseNeedsAcceptance( bLicenseNeedsAcceptance )
130     ,m_bLicenseWasAccepted(sal_False)
131     ,m_bAutomaticUpdChk(sal_True)
132     ,m_aThrobber(this, WizardResId(CTRL_THROBBER))
133     ,m_aLicensePath( rLicensePath )
134 {
135     FreeResource();
136     // ---
137 //	enableState(STATE_USER, sal_False);
138 //  enableState(STATE_REGISTRATION, sal_False);
139 
140     Size aTPSize(TP_WIDTH, TP_HEIGHT);
141     SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT));
142 
143     //set help id
144     m_pPrevPage->SetHelpId(HID_FIRSTSTART_PREV);
145     m_pNextPage->SetHelpId(HID_FIRSTSTART_NEXT);
146     m_pCancel->SetHelpId(HID_FIRSTSTART_CANCEL);
147     m_pFinish->SetHelpId(HID_FIRSTSTART_FINISH);
148     // m_pHelp->SetUniqueId(UID_FIRSTSTART_HELP);
149     m_pHelp->Hide();
150     m_pHelp->Disable();
151 
152     // save button lables
153     m_sNext = m_pNextPage->GetText();
154     m_sCancel = m_pCancel->GetText();
155 
156     // save cancel click handler
157     m_lnkCancel = m_pCancel->GetClickHdl();
158 
159     m_aDefaultPath = defineWizardPagesDependingFromContext();
160 	activatePath(m_aDefaultPath, sal_True);
161 
162     ActivatePage();
163 
164     // set text of finish putton:
165     m_pFinish->SetText(String(WizardResId(STR_FINISH)));
166     // disable "finish button"
167     enableButtons(WZB_FINISH, sal_False);
168     defaultButton(WZB_NEXT);
169 }
170 
171 void FirstStartWizard::DisableButtonsWhileMigration()
172 {
173     enableButtons(0xff, sal_False);
174 }
175 
176 ::svt::RoadmapWizardTypes::PathId FirstStartWizard::defineWizardPagesDependingFromContext()
177 {
178 	::svt::RoadmapWizardTypes::PathId aDefaultPath = 0;
179 
180     sal_Bool bPage_Welcome      = sal_True;
181     sal_Bool bPage_Migration    = sal_True;
182     sal_Bool bPage_User         = sal_True;
183     sal_Bool bPage_UpdateCheck  = sal_True;
184 
185     bPage_Migration   = Migration::checkMigration();
186     bPage_UpdateCheck = showOnlineUpdatePage();
187 
188     WizardPath aPath;
189     if (bPage_Welcome)
190         aPath.push_back(STATE_WELCOME);
191     if (bPage_Migration)
192         aPath.push_back(STATE_MIGRATION);
193     if (bPage_User)
194         aPath.push_back(STATE_USER);
195     if (bPage_UpdateCheck)
196         aPath.push_back(STATE_UPDATE_CHECK);
197 
198     declarePath(aDefaultPath, aPath);
199 
200 	// a) If license must be accepted by the user, all direct links
201 	//    to wizard tab pages must be disabled. Because such pages
202 	//	  should be accessible only in case license was accepted !
203 	// b) But if no license should be shown at all ...
204 	//    such direct links can be enabled by default.
205 	sal_Bool bAllowDirectLink = true;
206 
207     if (bPage_User)
208         enableState(STATE_USER, bAllowDirectLink);
209     if (bPage_UpdateCheck)
210         enableState(STATE_UPDATE_CHECK, bAllowDirectLink);
211     if (bPage_Migration)
212         enableState(STATE_MIGRATION, bAllowDirectLink);
213 
214 	return aDefaultPath;
215 }
216 
217 // catch F1 and disable help
218 long FirstStartWizard::PreNotify( NotifyEvent& rNEvt )
219 {
220     if( rNEvt.GetType() == EVENT_KEYINPUT )
221     {
222         const KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
223         if( rKey.GetCode() == KEY_F1 && ! rKey.GetModifier() )
224             return sal_True;
225     }
226     return RoadmapWizard::PreNotify(rNEvt);
227 }
228 
229 
230 void FirstStartWizard::enterState(WizardState _nState)
231 {
232     RoadmapWizard::enterState(_nState);
233     // default state
234     // all on
235     enableButtons(0xff, sal_True);
236     // finish off
237     enableButtons(WZB_FINISH, sal_False);
238     // default text
239     m_pCancel->SetText(m_sCancel);
240     m_pCancel->SetClickHdl(m_lnkCancel);
241     m_pNextPage->SetText(m_sNext);
242 
243     // default
244     defaultButton(WZB_NEXT);
245 
246     // specialized state
247     switch (_nState)
248     {
249     case STATE_WELCOME:
250         enableButtons(WZB_PREVIOUS, sal_False);
251         break;
252     case STATE_LICENSE:
253         m_pCancel->SetText(String(WizardResId(STR_LICENSE_DECLINE)));
254         m_pNextPage->SetText(String(WizardResId(STR_LICENSE_ACCEPT)));
255         enableButtons(WZB_NEXT, sal_False);
256         // attach warning dialog to cancel/decline button
257         m_pCancel->SetClickHdl( LINK(this, FirstStartWizard, DeclineHdl) );
258         break;
259     case STATE_REGISTRATION:
260         enableButtons(WZB_NEXT, sal_False);
261         enableButtons(WZB_FINISH, sal_True);
262         defaultButton(WZB_FINISH);
263         break;
264     }
265 
266     // focus
267 
268 }
269 
270 IMPL_LINK( FirstStartWizard, DeclineHdl, PushButton *, EMPTYARG )
271 {
272     QueryBox aBox(this, WizardResId(QB_ASK_DECLINE));
273     sal_Int32 ret = aBox.Execute();
274     if ( ret == BUTTON_OK || ret == BUTTON_YES)
275     {
276         Close();
277         return sal_False;
278     }
279     else
280         return sal_True;
281 }
282 
283 
284 TabPage* FirstStartWizard::createPage(WizardState _nState)
285 {
286     TabPage *pTabPage = 0;
287     switch (_nState)
288     {
289     case STATE_WELCOME:
290         pTabPage = new WelcomePage(this, WizardResId(TP_WELCOME), m_bLicenseNeedsAcceptance);
291         break;
292     case STATE_MIGRATION:
293         pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_aThrobber);
294         break;
295     case STATE_USER:
296         pTabPage = new UserPage(this, WizardResId(TP_USER));
297         break;
298     case STATE_UPDATE_CHECK:
299         pTabPage = new UpdateCheckPage(this, WizardResId(TP_UPDATE_CHECK));
300         break;
301     }
302     pTabPage->Show();
303 
304     return pTabPage;
305 }
306 
307 String FirstStartWizard::getStateDisplayName( WizardState _nState ) const
308 {
309     String sName;
310     switch(_nState)
311     {
312     case STATE_WELCOME:
313         sName = String(WizardResId(STR_STATE_WELCOME));
314         break;
315     case STATE_MIGRATION:
316         sName = String(WizardResId(STR_STATE_MIGRATION));
317         break;
318     case STATE_USER:
319         sName = String(WizardResId(STR_STATE_USER));
320         break;
321     case STATE_UPDATE_CHECK:
322         sName = String(WizardResId(STR_STATE_UPDATE_CHECK));
323         break;
324     }
325     return sName;
326 }
327 
328 sal_Bool FirstStartWizard::prepareLeaveCurrentState( CommitPageReason _eReason )
329 {
330     // the license acceptance is handled here, because it needs to change the state
331     // of the roadmap wizard which the page implementation does not know.
332     if (
333 		(_eReason              == eTravelForward) &&
334 		(getCurrentState()     == STATE_LICENSE ) &&
335 		(m_bLicenseWasAccepted == sal_False     )
336 	   )
337     {
338 		if (Migration::checkMigration())
339             enableState(FirstStartWizard::STATE_MIGRATION, sal_True);
340         if ( showOnlineUpdatePage() )
341             enableState(FirstStartWizard::STATE_UPDATE_CHECK, sal_True);
342 		enableState(FirstStartWizard::STATE_USER, sal_True);
343         enableState(FirstStartWizard::STATE_REGISTRATION, sal_True);
344 
345         storeAcceptDate();
346         m_bLicenseWasAccepted = sal_True;
347     }
348 
349     return svt::RoadmapWizard::prepareLeaveCurrentState(_eReason);
350 }
351 
352 sal_Bool FirstStartWizard::leaveState(WizardState)
353 {
354     if (( getCurrentState() == STATE_MIGRATION ) && m_bLicenseWasAccepted )
355     {
356         // Store accept date and patch level now as it has been
357         // overwritten by the migration process!
358         storeAcceptDate();
359         setPatchLevel();
360     }
361 
362     return sal_True;
363 }
364 
365 sal_Bool FirstStartWizard::onFinish()
366 {
367     // return sal_True;
368     if ( svt::RoadmapWizard::onFinish() )
369     {
370 #ifndef OS2 // cannot enable quickstart on first startup, see shutdownicon.cxx comments.
371         enableQuickstart();
372 #endif
373         disableWizard();
374         return sal_True;
375     }
376     else
377         return sal_False;
378 }
379 
380 short FirstStartWizard::Execute()
381 {
382     return svt::RoadmapWizard::Execute();
383 }
384 
385 static OUString _makeDateTimeString (const DateTime& aDateTime, sal_Bool bUTC = sal_False)
386 {
387     OStringBuffer aDateTimeString;
388     aDateTimeString.append((sal_Int32)aDateTime.GetYear());
389     aDateTimeString.append("-");
390     if (aDateTime.GetMonth()<10) aDateTimeString.append("0");
391     aDateTimeString.append((sal_Int32)aDateTime.GetMonth());
392     aDateTimeString.append("-");
393     if (aDateTime.GetDay()<10) aDateTimeString.append("0");
394     aDateTimeString.append((sal_Int32)aDateTime.GetDay());
395     aDateTimeString.append("T");
396     if (aDateTime.GetHour()<10) aDateTimeString.append("0");
397     aDateTimeString.append((sal_Int32)aDateTime.GetHour());
398     aDateTimeString.append(":");
399     if (aDateTime.GetMin()<10) aDateTimeString.append("0");
400     aDateTimeString.append((sal_Int32)aDateTime.GetMin());
401     aDateTimeString.append(":");
402     if (aDateTime.GetSec()<10) aDateTimeString.append("0");
403     aDateTimeString.append((sal_Int32)aDateTime.GetSec());
404     if (bUTC) aDateTimeString.append("Z");
405 
406     return OStringToOUString(aDateTimeString.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US);
407 }
408 
409 static OUString _getCurrentDateString()
410 {
411     OUString aString;
412     return _makeDateTimeString(DateTime());
413 }
414 
415 
416 static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
417 static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
418 static const OUString sReadSrvc  ( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" ) );
419 
420 void FirstStartWizard::storeAcceptDate()
421 {
422 
423     try {
424         Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
425         // get configuration provider
426         Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
427         xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
428         Sequence< Any > theArgs(1);
429         NamedValue v(OUString::createFromAscii("NodePath"),
430             makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
431         theArgs[0] <<= v;
432         Reference< XPropertySet > pset = Reference< XPropertySet >(
433             theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
434         Any result = pset->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate"));
435 
436         OUString aAcceptDate = _getCurrentDateString();
437         pset->setPropertyValue(OUString::createFromAscii("LicenseAcceptDate"), makeAny(aAcceptDate));
438         Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges();
439 
440 		// since the license is accepted the local user registry can be cleaned if required
441 		cleanOldOfficeRegKeys();
442     } catch (const Exception&)
443     {
444     }
445 
446 }
447 
448 void FirstStartWizard::setPatchLevel()
449 {
450     try {
451         Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
452         // get configuration provider
453         Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
454         xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
455         Sequence< Any > theArgs(1);
456         NamedValue v(OUString::createFromAscii("NodePath"),
457             makeAny(OUString::createFromAscii("org.openoffice.Office.Common/Help/Registration")));
458         theArgs[0] <<= v;
459         Reference< XPropertySet > pset = Reference< XPropertySet >(
460             theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
461         Any result = pset->getPropertyValue(OUString::createFromAscii("ReminderDate"));
462 
463         OUString aPatchLevel( RTL_CONSTASCII_USTRINGPARAM( "Patch" ));
464         aPatchLevel += OUString::valueOf( getBuildId(), 10 );
465         pset->setPropertyValue(OUString::createFromAscii("ReminderDate"), makeAny(aPatchLevel));
466         Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges();
467     } catch (const Exception&)
468     {
469     }
470 }
471 
472 #ifdef WNT
473 typedef int ( __stdcall * CleanCurUserRegProc ) ( wchar_t* );
474 #endif
475 
476 void FirstStartWizard::cleanOldOfficeRegKeys()
477 {
478 #ifdef WNT
479 	// after the wizard is completed clean OOo1.1.x entries in the current user registry if required
480 	// issue i47658
481 
482     OUString aBaseLocationPath;
483     OUString aSharedLocationPath;
484 	OUString aInstallMode;
485 
486 	::utl::Bootstrap::PathStatus aBaseLocateResult =
487         ::utl::Bootstrap::locateBaseInstallation( aBaseLocationPath );
488     ::utl::Bootstrap::PathStatus aSharedLocateResult =
489         ::utl::Bootstrap::locateSharedData( aSharedLocationPath );
490     aInstallMode = ::utl::Bootstrap::getAllUsersValue( ::rtl::OUString() );
491 
492 	// TODO: replace the checking for install mode
493     if ( aBaseLocateResult == ::utl::Bootstrap::PATH_EXISTS && aSharedLocateResult == ::utl::Bootstrap::PATH_EXISTS
494 	  && aInstallMode.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "1" ) ) ) )
495     {
496 		::rtl::OUString aDeregCompletePath =
497 					aBaseLocationPath + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/program/regcleanold.dll" ) );
498 		::rtl::OUString aExecCompletePath =
499 					aSharedLocationPath + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/regdeinstall/userdeinst.exe" ) );
500 
501 		osl::Module aCleanModule( aDeregCompletePath );
502 		CleanCurUserRegProc pNativeProc = ( CleanCurUserRegProc )(
503 					aCleanModule.getFunctionSymbol(
504 						::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CleanCurUserOldSystemRegistry" ) ) ) );
505 
506 		if( pNativeProc!=NULL )
507 		{
508 			::rtl::OUString aExecCompleteSysPath;
509 			if ( osl::File::getSystemPathFromFileURL( aExecCompletePath, aExecCompleteSysPath ) == FileBase::E_None
510 			  && aExecCompleteSysPath.getLength() )
511 			{
512 				( *pNativeProc )( (wchar_t*)( aExecCompleteSysPath.getStr() ) );
513 			}
514 		}
515 	}
516 #endif
517 }
518 
519 void FirstStartWizard::disableWizard()
520 {
521 
522     try {
523         Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
524         // get configuration provider
525         Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
526         xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
527         Sequence< Any > theArgs(1);
528         NamedValue v(OUString::createFromAscii("NodePath"),
529             makeAny(OUString::createFromAscii("org.openoffice.Setup/Office")));
530         theArgs[0] <<= v;
531         Reference< XPropertySet > pset = Reference< XPropertySet >(
532             theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
533         pset->setPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"), makeAny(sal_True));
534         Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges();
535     } catch (const Exception&)
536     {
537     }
538 
539 }
540 
541 
542 void FirstStartWizard::enableQuickstart()
543 {
544     sal_Bool bQuickstart( sal_True );
545     sal_Bool bAutostart( sal_True );
546     Sequence< Any > aSeq( 2 );
547     aSeq[0] <<= bQuickstart;
548     aSeq[1] <<= bAutostart;
549 
550     Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
551         OUString::createFromAscii( "com.sun.star.office.Quickstart" )),UNO_QUERY );
552     if ( xQuickstart.is() )
553         xQuickstart->initialize( aSeq );
554 
555 }
556 
557 sal_Bool FirstStartWizard::showOnlineUpdatePage()
558 {
559     try {
560         Reference < XNameReplace > xUpdateAccess;
561         Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
562 
563         xUpdateAccess = Reference < XNameReplace >(
564             xFactory->createInstance( UNISTRING( "com.sun.star.setup.UpdateCheckConfig" ) ), UNO_QUERY_THROW );
565 
566         if ( xUpdateAccess.is() )
567         {
568             sal_Bool bAutoUpdChk = sal_False;
569             Any result = xUpdateAccess->getByName( UNISTRING( "AutoCheckEnabled" ) );
570             result >>= bAutoUpdChk;
571             if ( bAutoUpdChk == sal_False )
572                 return sal_True;
573             else
574                 return sal_False;
575         }
576     } catch (const Exception&)
577     {
578     }
579     return sal_False;
580 }
581 
582 }
583