diff options
Diffstat (limited to 'desktop/source/so_comp/oemjob.cxx')
-rw-r--r-- | desktop/source/so_comp/oemjob.cxx | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/desktop/source/so_comp/oemjob.cxx b/desktop/source/so_comp/oemjob.cxx index 21b78b5923..64767d180d 100644 --- a/desktop/source/so_comp/oemjob.cxx +++ b/desktop/source/so_comp/oemjob.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,14 +68,14 @@ const char* OEMPreloadJob::serviceName = "com.sun.star.office.OEMPreloadJob"; OUString OEMPreloadJob::GetImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationName)); + return OUString::createFromAscii(implementationName); } 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; @@ -88,7 +89,7 @@ Reference< XInterface > SAL_CALL OEMPreloadJob::CreateInstance( return (XComponent*) ( new OEMPreloadJob( rSMgr ) ); } -OEMPreloadJob::OEMPreloadJob( const Reference< XMultiServiceFactory >& xFactory ) : +OEMPreloadJob::OEMPreloadJob( const Reference< XMultiServiceFactory >& xFactory ) : m_aListeners( m_aMutex ), m_xServiceManager( xFactory ) { @@ -117,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(); @@ -150,7 +151,7 @@ throw ( RuntimeException ) { // create OEM preload service dialog Reference <XExecutableDialog> xDialog( m_xServiceManager->createInstance( - OUString::createFromAscii("org.openoffice.comp.preload.OEMPreloadWizard")), + OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.preload.OEMPreloadWizard"))), UNO_QUERY ); if ( xDialog.is() ){ // execute OEM preload dialog and check return value @@ -160,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(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), UNO_QUERY ); xDesktop->terminate(); */ @@ -175,18 +176,18 @@ throw ( RuntimeException ) Reference<XModel> rModel; Reference<XCloseable> rClose; for (int i=0; i<args.getLength(); i++) - { - if (args[i].Name.equalsAscii("EnvType")) + { + if (args[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EnvType"))) args[i].Value >>= aEnvType; - else if (args[i].Name.equalsAscii("Frame")) { + else if (args[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Frame"))) { args[i].Value >>= rFrame; rClose = Reference<XCloseable>(rFrame, UNO_QUERY); } - else if (args[i].Name.equalsAscii("Model")) { + else if (args[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Model"))) { args[i].Value >>= rModel; rClose = Reference<XCloseable>(rModel, UNO_QUERY); - } - } + } + } if (rClose.is()) rClose->close(sal_True); */ bCont = sal_False; @@ -195,10 +196,10 @@ throw ( RuntimeException ) } else { // don't try again bCont = sal_True; - } + } /* - NamedValue nv; - nv.Name = OUString::createFromAscii("Deactivate"); + NamedValue nv; + nv.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Deactivate")); nv.Value <<= bDeactivate; Sequence<NamedValue> s(1); s[0] = nv; @@ -208,32 +209,30 @@ throw ( RuntimeException ) return r; } - 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; } - // locate soffice.ini/.rc file 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 ) { @@ -242,11 +241,11 @@ static OUString locateIniFile() 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; } @@ -269,7 +268,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 ); @@ -278,3 +277,5 @@ void OEMPreloadJob::disableOEMPreloadFlag() } } // namespace desktop + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |