diff options
Diffstat (limited to 'desktop/source/so_comp/oemjob.cxx')
-rw-r--r-- | desktop/source/so_comp/oemjob.cxx | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/desktop/source/so_comp/oemjob.cxx b/desktop/source/so_comp/oemjob.cxx index 15e05a7bf61d..22bad75af489 100644 --- a/desktop/source/so_comp/oemjob.cxx +++ b/desktop/source/so_comp/oemjob.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,9 +54,9 @@ using namespace ::com::sun::star::util; namespace desktop{ char const OEM_PRELOAD_SECTION[] = "Bootstrap"; -char const OEM_PRELOAD[] = "Preload"; -char const STR_TRUE[] = "1"; -char const STR_FALSE[] = "0"; +char const OEM_PRELOAD[] = "Preload"; +char const STR_TRUE[] = "1"; +char const STR_FALSE[] = "0"; const char* OEMPreloadJob::interfaces[] = { @@ -75,7 +75,7 @@ Sequence< OUString > OEMPreloadJob::GetSupportedServiceNames() { sal_Int32 nSize = (sizeof( interfaces ) / sizeof( const char *)) - 1; Sequence< OUString > aResult( nSize ); - + for( sal_Int32 i = 0; i < nSize; i++ ) aResult[i] = OUString::createFromAscii( interfaces[i] ); return aResult; @@ -84,12 +84,12 @@ Sequence< OUString > OEMPreloadJob::GetSupportedServiceNames() Reference< XInterface > SAL_CALL OEMPreloadJob::CreateInstance( const Reference< XMultiServiceFactory >& rSMgr ) { - static osl::Mutex aMutex; + static osl::Mutex aMutex; osl::MutexGuard guard( aMutex ); return (XComponent*) ( new OEMPreloadJob( rSMgr ) ); } -OEMPreloadJob::OEMPreloadJob( const Reference< XMultiServiceFactory >& xFactory ) : +OEMPreloadJob::OEMPreloadJob( const Reference< XMultiServiceFactory >& xFactory ) : m_aListeners( m_aMutex ), m_xServiceManager( xFactory ) { @@ -118,24 +118,24 @@ void SAL_CALL OEMPreloadJob::removeEventListener( const Reference< XEventListene } // XServiceInfo -::rtl::OUString SAL_CALL OEMPreloadJob::getImplementationName() +::rtl::OUString SAL_CALL OEMPreloadJob::getImplementationName() throw ( RuntimeException ) { return OEMPreloadJob::GetImplementationName(); } -sal_Bool SAL_CALL OEMPreloadJob::supportsService( const ::rtl::OUString& rServiceName ) +sal_Bool SAL_CALL OEMPreloadJob::supportsService( const ::rtl::OUString& rServiceName ) throw ( RuntimeException ) { sal_Int32 nSize = sizeof( interfaces ) / sizeof( const char *); - + for( sal_Int32 i = 0; i < nSize; i++ ) if ( rServiceName.equalsAscii( interfaces[i] )) return sal_True; return sal_False; } -Sequence< ::rtl::OUString > SAL_CALL OEMPreloadJob::getSupportedServiceNames() +Sequence< ::rtl::OUString > SAL_CALL OEMPreloadJob::getSupportedServiceNames() throw ( RuntimeException ) { return OEMPreloadJob::GetSupportedServiceNames(); @@ -151,7 +151,7 @@ throw ( RuntimeException ) { // create OEM preload service dialog Reference <XExecutableDialog> xDialog( m_xServiceManager->createInstance( - OUString::createFromAscii("org.openoffice.comp.preload.OEMPreloadWizard")), + OUString::createFromAscii("org.openoffice.comp.preload.OEMPreloadWizard")), UNO_QUERY ); if ( xDialog.is() ){ // execute OEM preload dialog and check return value @@ -161,11 +161,11 @@ throw ( RuntimeException ) bCont = sal_True; disableOEMPreloadFlag(); } else { - // user declined... + // user declined... // terminate. /* Reference< XDesktop > xDesktop( m_xServiceManager->createInstance( - OUString::createFromAscii("com.sun.star.frame.Desktop")), + OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY ); xDesktop->terminate(); */ @@ -176,7 +176,7 @@ throw ( RuntimeException ) Reference<XModel> rModel; Reference<XCloseable> rClose; for (int i=0; i<args.getLength(); i++) - { + { if (args[i].Name.equalsAscii("EnvType")) args[i].Value >>= aEnvType; else if (args[i].Name.equalsAscii("Frame")) { @@ -186,8 +186,8 @@ throw ( RuntimeException ) else if (args[i].Name.equalsAscii("Model")) { args[i].Value >>= rModel; rClose = Reference<XCloseable>(rModel, UNO_QUERY); - } - } + } + } if (rClose.is()) rClose->close(sal_True); */ bCont = sal_False; @@ -196,9 +196,9 @@ throw ( RuntimeException ) } else { // don't try again bCont = sal_True; - } + } /* - NamedValue nv; + NamedValue nv; nv.Name = OUString::createFromAscii("Deactivate"); nv.Value <<= bDeactivate; Sequence<NamedValue> s(1); @@ -214,10 +214,10 @@ static sal_Bool existsURL( OUString const& _sURL ) { using namespace osl; DirectoryItem aDirItem; - + if (_sURL.getLength() != 0) return ( DirectoryItem::get( _sURL, aDirItem ) == DirectoryItem::E_None ); - + return sal_False; } @@ -227,27 +227,27 @@ static OUString locateIniFile() { OUString aUserDataPath; OUString aSofficeIniFileURL; - + // Retrieve the default file URL for the soffice.ini/rc Bootstrap().getIniName( aSofficeIniFileURL ); if ( utl::Bootstrap::locateUserData( aUserDataPath ) == utl::Bootstrap::PATH_EXISTS ) { const char CONFIG_DIR[] = "/config"; - + sal_Int32 nIndex = aSofficeIniFileURL.lastIndexOf( '/'); if ( nIndex > 0 ) { - OUString aUserSofficeIniFileURL; - OUStringBuffer aBuffer( aUserDataPath ); + OUString aUserSofficeIniFileURL; + OUStringBuffer aBuffer( aUserDataPath ); aBuffer.appendAscii( CONFIG_DIR ); aBuffer.append( aSofficeIniFileURL.copy( nIndex )); aUserSofficeIniFileURL = aBuffer.makeStringAndClear(); - + if ( existsURL( aUserSofficeIniFileURL )) return aUserSofficeIniFileURL; } - } + } // Fallback try to use the soffice.ini/rc from program folder return aSofficeIniFileURL; } @@ -270,7 +270,7 @@ void OEMPreloadJob::disableOEMPreloadFlag() { OUString aSofficeIniFileURL = locateIniFile(); if ( aSofficeIniFileURL.getLength() > 0 ) - { + { Config aConfig(aSofficeIniFileURL); aConfig.SetGroup( OEM_PRELOAD_SECTION ); aConfig.WriteKey( OEM_PRELOAD, STR_FALSE ); |