avmedia/source/framework/mediaitem.cxx | 7 - comphelper/inc/comphelper/processfactory.hxx | 30 +--- comphelper/source/processfactory/processfactory.cxx | 41 ++--- desktop/inc/app.hxx | 19 +- desktop/source/app/app.cxx | 139 +++++++++----------- desktop/source/app/desktop.hrc | 1 desktop/source/app/desktop.src | 5 desktop/source/app/sofficemain.cxx | 21 --- editeng/source/misc/svxacorr.cxx | 2 svx/source/accessibility/AccessibleControlShape.cxx | 2 toolkit/source/controls/formattedcontrol.cxx | 2 vcl/aqua/source/app/salsys.cxx | 19 +- vcl/generic/app/gensys.cxx | 60 +++++++- vcl/inc/aqua/salsys.h | 2 vcl/inc/generic/gensys.h | 2 vcl/inc/ios/salsys.h | 2 vcl/inc/salsys.hxx | 7 - vcl/inc/win/salsys.h | 2 vcl/ios/source/app/salsys.cxx | 19 +- vcl/source/app/svapp.cxx | 2 vcl/source/app/svdata.cxx | 12 - vcl/source/app/svmain.cxx | 2 vcl/source/gdi/impimagetree.cxx | 3 vcl/unx/generic/plugadapt/salplug.cxx | 16 -- vcl/win/source/app/salinfo.cxx | 2 25 files changed, 209 insertions(+), 210 deletions(-)
New commits: commit 2a32bf29b98403872235f880e91b1c08cd3d7f68 Author: Stephan Bergmann <[email protected]> Date: Tue Sep 18 12:47:55 2012 +0200 Make getProcessComponentContext/ServiceFactory throw instead of returning null ...with the same rationale as recent 543158edba6678d3d76eee983a9d4edd2a422fee "Require XComponentContext.getServiceManager to throw instead of returning null" (this helps find problems like 065a758d0c2b66c6683d648347b7a6cdef4a80f7 "Enable experimental gtk3 plugin only via SAL_USE_VCLPLUGIN"). Removed comphelper::createProcessComponent[WithAguments] and replaced its few uses with direct calls to createInstance[WithArguments]. Change-Id: Ia44b8656f74de88ef6eab3eb6bd597729b08e1c8 diff --git a/comphelper/inc/comphelper/processfactory.hxx b/comphelper/inc/comphelper/processfactory.hxx index dbcd647..e6833fc 100644 --- a/comphelper/inc/comphelper/processfactory.hxx +++ b/comphelper/inc/comphelper/processfactory.hxx @@ -39,34 +39,17 @@ namespace comphelper COMPHELPER_DLLPUBLIC void setProcessServiceFactory(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr); /** - * This function get the process service factory. If no service factory is set the function returns - * a null interface. + * This function gets the process service factory. + * + * If no service factory is set the function throws a RuntimeException. * * @author Juergen Schmidt */ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getProcessServiceFactory(); -/** creates a component, using the process factory if set - @see getProcessServiceFactory - @see setProcessServiceFactory -*/ -COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - createProcessComponent( - const ::rtl::OUString& _rServiceSpecifier - ) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); - -/** creates a component with arguments, using the process factory if set +/** Obtains a component context from a service factory. - @see getProcessServiceFactory - @see setProcessServiceFactory -*/ -COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - createProcessComponentWithArguments( - const ::rtl::OUString& _rServiceSpecifier, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArgs - ) SAL_THROW( ( ::com::sun::star::uno::RuntimeException ) ); - -/** Tries to obtain a component context from a service factory. + Throws a RuntimeException if no component context can be obtained. @param factory may be null @return may be null @@ -79,7 +62,8 @@ getComponentContext( /** * This function gets the process service factory's default component context. - * If no service factory is set the function returns a null interface. + * + * Throws a RuntimeException if no component context can be obtained. */ COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > diff --git a/comphelper/source/processfactory/processfactory.cxx b/comphelper/source/processfactory/processfactory.cxx index c44d579..deb9b4f 100644 --- a/comphelper/source/processfactory/processfactory.cxx +++ b/comphelper/source/processfactory/processfactory.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include "com/sun/star/beans/XPropertySet.hpp" - +#include "com/sun/star/uno/DeploymentException.hpp" using namespace ::com::sun::star; using namespace com::sun::star::uno; @@ -59,32 +59,14 @@ Reference< XMultiServiceFactory > getProcessServiceFactory() { Reference< XMultiServiceFactory> xReturn; xReturn = localProcessFactory( xReturn, sal_False ); + if ( !xReturn.is() ) + { + throw DeploymentException( + "null process service factory", Reference< XInterface >() ); + } return xReturn; } -Reference< XInterface > createProcessComponent( const ::rtl::OUString& _rServiceSpecifier ) SAL_THROW( ( RuntimeException ) ) -{ - Reference< XInterface > xComponent; - - Reference< XMultiServiceFactory > xFactory( getProcessServiceFactory() ); - if ( xFactory.is() ) - xComponent = xFactory->createInstance( _rServiceSpecifier ); - - return xComponent; -} - -Reference< XInterface > createProcessComponentWithArguments( const ::rtl::OUString& _rServiceSpecifier, - const Sequence< Any >& _rArgs ) SAL_THROW( ( RuntimeException ) ) -{ - Reference< XInterface > xComponent; - - Reference< XMultiServiceFactory > xFactory( getProcessServiceFactory() ); - if ( xFactory.is() ) - xComponent = xFactory->createInstanceWithArguments( _rServiceSpecifier, _rArgs ); - - return xComponent; -} - Reference< XComponentContext > getComponentContext( Reference< XMultiServiceFactory > const & factory) { @@ -96,9 +78,18 @@ Reference< XComponentContext > getComponentContext( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ), uno::UNO_QUERY ); } - catch (beans::UnknownPropertyException const&) { + catch (beans::UnknownPropertyException & e) { + throw DeploymentException( + "unknown service factory DefaultContext property: " + e.Message, + Reference< XInterface >( factory, UNO_QUERY ) ); } } + if ( !xRet.is() ) + { + throw DeploymentException( + "no service factory DefaultContext", + Reference< XInterface >( factory, UNO_QUERY ) ); + } return xRet; } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index ed83e4d..68c0d29 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -443,7 +443,7 @@ sal_Bool SvxAutoCorrect::FnChgOrdinalNumber( // Check if the characters after that number correspond to the ordinal suffix rtl::OUString sServiceName("com.sun.star.i18n.OrdinalSuffix"); uno::Reference< i18n::XOrdinalSuffix > xOrdSuffix( - comphelper::createProcessComponent( sServiceName ), + comphelper::getProcessServiceFactory()->createInstance( sServiceName ), uno::UNO_QUERY ); if ( xOrdSuffix.is( ) ) diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 9f9734b..0ddd918 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -270,7 +270,7 @@ void AccessibleControlShape::Init() // finally, aggregate a proxy for the control context // first a factory for the proxy Reference< XProxyFactory > xFactory; - xFactory = xFactory.query( createProcessComponent( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.ProxyFactory" ) ) ) ); + xFactory = xFactory.query( getProcessServiceFactory()->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.ProxyFactory" ) ) ) ); OSL_ENSURE( xFactory.is(), "AccessibleControlShape::Init: could not create a proxy factory!" ); // then the proxy itself if ( xFactory.is() && xNativeControlContext.is() ) diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx index 230f966..93c8f17 100644 --- a/toolkit/source/controls/formattedcontrol.cxx +++ b/toolkit/source/controls/formattedcontrol.cxx @@ -84,7 +84,7 @@ namespace toolkit { rbTriedCreation = true; rDefaultFormats = Reference< XNumberFormatsSupplier >( - ::comphelper::createProcessComponent( + ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatsSupplier" ) ) ), UNO_QUERY_THROW ); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index fe895a5..285f713 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -487,7 +487,7 @@ void DeInitVCL() try { uno::Reference<lang::XComponent> const xDesktop( - comphelper::createProcessComponent( + comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), uno::UNO_QUERY_THROW) ; diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx index 374ce85..1e34be3 100644 --- a/vcl/source/gdi/impimagetree.cxx +++ b/vcl/source/gdi/impimagetree.cxx @@ -39,6 +39,7 @@ #include "com/sun/star/container/XNameAccess.hpp" #include "com/sun/star/io/XInputStream.hpp" #include "com/sun/star/lang/Locale.hpp" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/uno/Any.hxx" #include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Reference.hxx" @@ -409,7 +410,7 @@ bool ImplImageTree::find( args[0] <<= i->first + ".zip"; try { i->second.set( - comphelper::createProcessComponentWithArguments( + comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( "com.sun.star.packages.zip.ZipFileAccess"), args), css::uno::UNO_QUERY_THROW); commit cccc6bcfa095121c91e8bbc396f5bcf7e95424b9 Author: Stephan Bergmann <[email protected]> Date: Tue Sep 18 12:40:57 2012 +0200 Don't access broken service mgr during bootstrap failure ...so that displaying a (non-translated) error box upon BE_UNO_SERVICEMANAGER works after all. Augment the error text with an exception message where appropriate. This allows to revert fdfb7a3c4b3a89b73ab5546b9620348bc4984d8f "Related fdo#51252: Report uncaught exceptions with MessageBox on Windows" as that was to catch and display failures from instantiating the service mgr. Change-Id: I049a38e95342634796eb0e940e2ee8e55193c9d3 diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 8fd717e..b1577b2 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -103,15 +103,16 @@ class Desktop : public Application static ResMgr* GetDesktopResManager(); static CommandLineArgs& GetCommandLineArgs(); - void HandleBootstrapErrors( BootstrapError ); - void SetBootstrapError( BootstrapError nError ) + void HandleBootstrapErrors( + BootstrapError nError, OUString const & aMessage ); + void SetBootstrapError( + BootstrapError nError, OUString const & aMessage ) { if ( m_aBootstrapError == BE_OK ) + { m_aBootstrapError = nError; - } - BootstrapError GetBootstrapError() const - { - return m_aBootstrapError; + m_aBootstrapErrorMessage = aMessage; + } } void SetBootstrapStatus( BootstrapStatus nStatus ) @@ -135,8 +136,6 @@ class Desktop : public Application void SetSplashScreenText( const ::rtl::OUString& rText ); void SetSplashScreenProgress( sal_Int32 ); - static void ensureProcessServiceFactory(); - private: // Bootstrap methods static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > CreateApplicationServiceManager(); @@ -159,9 +158,6 @@ class Desktop : public Application void HandleBootstrapPathErrors( ::utl::Bootstrap::Status, const ::rtl::OUString& aMsg ); void StartSetup( const ::rtl::OUString& aParameters ); - // Get a resource message string securely e.g. if resource cannot be retrieved return aFaultBackMsg - ::rtl::OUString GetMsgString( sal_uInt16 nId, const ::rtl::OUString& aFaultBackMsg ); - // Create a error message depending on bootstrap failure code and an optional file url ::rtl::OUString CreateErrorMsgString( utl::Bootstrap::FailureCode nFailureCode, const ::rtl::OUString& aFileURL ); @@ -200,6 +196,7 @@ class Desktop : public Application bool m_bCleanedExtensionCache; bool m_bServicesRegistered; BootstrapError m_aBootstrapError; + OUString m_aBootstrapErrorMessage; BootstrapStatus m_aBootstrapStatus; std::auto_ptr< Lockfile > m_pLockfile; diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 1781d66..fad9908 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -378,28 +378,34 @@ ResMgr* Desktop::GetDesktopResManager() return Desktop::pResMgr; } +namespace { + // ---------------------------------------------------------------------------- // Get a message string securely. There is a fallback string if the resource // is not available. -OUString Desktop::GetMsgString( sal_uInt16 nId, const OUString& aFaultBackMsg ) +OUString GetMsgString( + sal_uInt16 nId, const OUString& aFaultBackMsg, + bool bAlwaysUseFaultBackMsg = false ) { - ResMgr* resMgr = GetDesktopResManager(); - if ( !resMgr ) - return aFaultBackMsg; - else - return OUString( String( ResId( nId, *resMgr ))); + if ( !bAlwaysUseFaultBackMsg ) + { + ResMgr* resMgr = Desktop::GetDesktopResManager(); + if ( resMgr ) + return OUString( String( ResId( nId, *resMgr ))); + } + return aFaultBackMsg; } -OUString MakeStartupErrorMessage(OUString const & aErrorMessage) +OUString MakeStartupErrorMessage( + OUString const & aErrorMessage, bool bAlwaysUseFaultBackMsg = false ) { OUStringBuffer aDiagnosticMessage( 100 ); - ResMgr* pResMgr = Desktop::GetDesktopResManager(); - if ( pResMgr ) - aDiagnosticMessage.append( OUString(String(ResId(STR_BOOTSTRAP_ERR_CANNOT_START, *pResMgr))) ); - else - aDiagnosticMessage.appendAscii( "The program cannot be started." ); + aDiagnosticMessage.append( + GetMsgString( + STR_BOOTSTRAP_ERR_CANNOT_START, "The program cannot be started.", + bAlwaysUseFaultBackMsg ) ); aDiagnosticMessage.appendAscii( "\n" ); @@ -468,9 +474,8 @@ static bool ShouldSuppressUI(const CommandLineArgs& rCmdLine) rCmdLine.IsQuickstart(); } -namespace -{ - struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {}; +struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {}; + } CommandLineArgs& Desktop::GetCommandLineArgs() @@ -591,29 +596,30 @@ void Desktop::Init() // We need to have service factory before going further, but see fdo#37195. // Doing this will mmap common.rdb, making it not overwritable on windows, // so this can't happen before the synchronization above. Lets rework this - // so that the above is called *from* ensureProcessServiceFactory or + // so that the above is called *from* CreateApplicationServiceManager or // something to enforce this gotcha - ensureProcessServiceFactory(); - - if( !::comphelper::getProcessServiceFactory().is()) + try + { + comphelper::setProcessServiceFactory(CreateApplicationServiceManager()); + } + catch (css::uno::Exception & e) { - OSL_FAIL("Service factory should have been crated in soffice_main()."); - SetBootstrapError( BE_UNO_SERVICEMANAGER ); + SetBootstrapError( BE_UNO_SERVICEMANAGER, e.Message ); } - if ( GetBootstrapError() == BE_OK ) + if ( m_aBootstrapError == BE_OK ) { // prepare language if ( !LanguageSelection::prepareLanguage() ) { if ( LanguageSelection::getStatus() == LanguageSelection::LS_STATUS_CANNOT_DETERMINE_LANGUAGE ) - SetBootstrapError( BE_LANGUAGE_MISSING ); + SetBootstrapError( BE_LANGUAGE_MISSING, OUString() ); else - SetBootstrapError( BE_OFFICECONFIG_BROKEN ); + SetBootstrapError( BE_OFFICECONFIG_BROKEN, OUString() ); } } - if ( GetBootstrapError() == BE_OK ) + if ( m_aBootstrapError == BE_OK ) { const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs(); // start ipc thread only for non-remote offices @@ -621,7 +627,7 @@ void Desktop::Init() OfficeIPCThread::Status aStatus = OfficeIPCThread::EnableOfficeIPCThread(); if ( aStatus == OfficeIPCThread::IPC_STATUS_BOOTSTRAP_ERROR ) { - SetBootstrapError( BE_PATHINFO_MISSING ); + SetBootstrapError( BE_PATHINFO_MISSING, OUString() ); } else if ( aStatus == OfficeIPCThread::IPC_STATUS_2ND_OFFICE ) { @@ -644,29 +650,6 @@ void Desktop::InitFinished() CloseSplashScreen(); } -// GetCommandLineArgs() requires this code to work, otherwise it will abort, and -// on Unix command line args needs to be checked before Desktop::Init() -void Desktop::ensureProcessServiceFactory() -{ - if (!comphelper::getProcessServiceFactory().is()) - { - try - { - comphelper::setProcessServiceFactory( - CreateApplicationServiceManager()); - } - catch (const css::uno::Exception& e) - { - // Application::ShowNativeErrorBox would only work after InitVCL, so - // all we can realistically do here is hope the user can see stderr: - std::cerr << "UNO Exception: " << e.Message << std::endl; - // Let exceptions escape and tear down the process, it is completely - // broken anyway: - throw; - } - } -} - void Desktop::DeInit() { RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::DeInit" ); @@ -881,7 +864,8 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat return MakeStartupErrorMessage( aMsg ); } -void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) +void Desktop::HandleBootstrapErrors( + BootstrapError aBootstrapError, OUString const & aErrorMessage ) { if ( aBootstrapError == BE_PATHINFO_MISSING ) { @@ -962,16 +946,18 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) // PropertyValue is available). To give the user a hint even if // generating and displaying a message box below crashes, print a // hard-coded message on stderr first: - fputs( - aBootstrapError == BE_UNO_SERVICEMANAGER - ? ("The application cannot be started. " "\n" - "The component manager is not available." "\n") - // STR_BOOTSTRAP_ERR_CANNOT_START, STR_BOOTSTRAP_ERR_NO_SERVICE - : ("The application cannot be started. " "\n" - "The configuration service is not available." "\n"), - // STR_BOOTSTRAP_ERR_CANNOT_START, - // STR_BOOTSTRAP_ERR_NO_CFG_SERVICE - stderr); + std::cerr + << "The application cannot be started.\n" + // STR_BOOTSTRAP_ERR_CANNOT_START + << (aBootstrapError == BE_UNO_SERVICEMANAGER + ? "The component manager is not available.\n" + // STR_BOOTSTRAP_ERR_NO_SERVICE + : "The configuration service is not available.\n"); + // STR_BOOTSTRAP_ERR_NO_CFG_SERVICE + if ( !aErrorMessage.isEmpty() ) + { + std::cerr << "(\"" << aErrorMessage << "\")\n"; + } // First sentence. We cannot bootstrap office further! OUString aMessage; @@ -980,24 +966,32 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) OUString aErrorMsg; if ( aBootstrapError == BE_UNO_SERVICEMANAGER ) - aErrorMsg = GetMsgString( STR_BOOTSTRAP_ERR_NO_SERVICE, - OUString( "The service manager is not available." ) ); + aErrorMsg = "The service manager is not available."; else aErrorMsg = GetMsgString( STR_BOOTSTRAP_ERR_NO_CFG_SERVICE, OUString( "The configuration service is not available." ) ); aDiagnosticMessage.append( aErrorMsg ); aDiagnosticMessage.appendAscii( "\n" ); + if ( !aErrorMessage.isEmpty() ) + { + aDiagnosticMessage.appendAscii( "(\"" ); + aDiagnosticMessage.append( aErrorMessage ); + aDiagnosticMessage.appendAscii( "\")\n" ); + } // Due to the fact the we haven't a backup applicat.rdb file anymore it is not possible to // repair the installation with the setup executable besides the office executable. Now // we have to ask the user to start the setup on CD/installation directory manually!! OUString aStartSetupManually( GetMsgString( STR_ASK_START_SETUP_MANUALLY, - OUString( "Start setup application to repair the installation from CD, or the folder containing the installation packages." ) )); + OUString( "Start setup application to repair the installation from CD, or the folder containing the installation packages." ), + aBootstrapError == BE_UNO_SERVICEMANAGER ) ); aDiagnosticMessage.append( aStartSetupManually ); - aMessage = MakeStartupErrorMessage( aDiagnosticMessage.makeStringAndClear() ); + aMessage = MakeStartupErrorMessage( + aDiagnosticMessage.makeStringAndClear(), + aBootstrapError == BE_UNO_SERVICEMANAGER ); FatalError( aMessage); } @@ -1378,10 +1372,9 @@ int Desktop::Main() com::sun::star::uno::ContextLayer layer( com::sun::star::uno::getCurrentContext() ); - BootstrapError eError = GetBootstrapError(); - if ( eError != BE_OK ) + if ( m_aBootstrapError != BE_OK ) { - HandleBootstrapErrors( eError ); + HandleBootstrapErrors( m_aBootstrapError, m_aBootstrapErrorMessage ); return EXIT_FAILURE; } @@ -1415,11 +1408,12 @@ int Desktop::Main() { OSL_FAIL("userinstall failed"); if ( inst_fin == UserInstall::E_NoDiskSpace ) - HandleBootstrapErrors( BE_USERINSTALL_NOTENOUGHDISKSPACE ); + HandleBootstrapErrors( + BE_USERINSTALL_NOTENOUGHDISKSPACE, OUString() ); else if ( inst_fin == UserInstall::E_NoWriteAccess ) - HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS ); + HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS, OUString() ); else - HandleBootstrapErrors( BE_USERINSTALL_FAILED ); + HandleBootstrapErrors( BE_USERINSTALL_FAILED, OUString() ); return EXIT_FAILURE; } // refresh path information @@ -1797,9 +1791,10 @@ bool Desktop::InitializeConfiguration() comphelper::getProcessComponentContext() ); return true; } - catch( const ::com::sun::star::lang::ServiceNotRegisteredException& ) + catch( ::com::sun::star::lang::ServiceNotRegisteredException & e ) { - this->HandleBootstrapErrors( Desktop::BE_UNO_SERVICE_CONFIG_MISSING ); + this->HandleBootstrapErrors( + Desktop::BE_UNO_SERVICE_CONFIG_MISSING, e.Message ); } catch( const ::com::sun::star::configuration::MissingBootstrapFileException& e ) { diff --git a/desktop/source/app/desktop.hrc b/desktop/source/app/desktop.hrc index 3b01f24..5551db8 100644 --- a/desktop/source/app/desktop.hrc +++ b/desktop/source/app/desktop.hrc @@ -51,7 +51,6 @@ #define STR_BOOTSTRAP_ERR_NO_SUPPORT (RID_DESKTOP_STRING_START+107) #define STR_BOOTSTRAP_ERR_LANGUAGE_MISSING (RID_DESKTOP_STRING_START+108) -#define STR_BOOTSTRAP_ERR_NO_SERVICE (RID_DESKTOP_STRING_START+120) #define STR_BOOTSTRAP_ERR_NO_CFG_SERVICE (RID_DESKTOP_STRING_START+121) #define STR_BOOTSTRAP_ERR_CFG_DATAACCESS (RID_DESKTOP_STRING_START+122) #define STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE (RID_DESKTOP_STRING_START+123) diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src index 67651bc..4e4270f 100644 --- a/desktop/source/app/desktop.src +++ b/desktop/source/app/desktop.src @@ -88,11 +88,6 @@ String STR_BOOTSTRAP_ERR_LANGUAGE_MISSING Text [ en-US ] = "The user interface language cannot be determined."; }; -String STR_BOOTSTRAP_ERR_NO_SERVICE -{ - Text [ en-US ] = "The component manager is not available."; -}; - String STR_BOOTSTRAP_ERR_NO_CFG_SERVICE { Text [ en-US ] = "The configuration service is not available."; diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index a0fba04..e867601 100755 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -38,21 +38,14 @@ #include <rtl/bootstrap.hxx> #include <tools/extendapplicationenvironment.hxx> -#if defined WNT -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - int SVMain(); // -=-= main() -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= extern "C" int DESKTOP_DLLPUBLIC soffice_main() { -#if defined ANDROID || defined WNT +#if defined ANDROID try { -#endif -#if defined(ANDROID) rtl::Bootstrap::setIniFilename( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///assets/program/lofficerc"))); #endif @@ -83,20 +76,10 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() } #endif return SVMain(); -#if defined ANDROID || defined WNT - } catch (const ::com::sun::star::uno::Exception &e) { #if defined ANDROID + } catch (const ::com::sun::star::uno::Exception &e) { fprintf (stderr, "Not handled UNO exception at main: '%s'\n", rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); -#elif defined WNT - MessageBoxW( - 0, - reinterpret_cast< LPCWSTR >( - rtl::OUString("Unhandled exception:\n" + e.Message).getStr()), - reinterpret_cast< LPCWSTR >(rtl::OUString("Fatal Error").getStr()), - (MB_OK | MB_ICONERROR | MB_DEFBUTTON1 | MB_TASKMODAL - | MB_SETFOREGROUND | MB_TOPMOST)); -#endif throw; // to get exception type printed } #endif diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx index 7c6f683..6c65178 100644 --- a/vcl/aqua/source/app/salsys.cxx +++ b/vcl/aqua/source/app/salsys.cxx @@ -106,9 +106,13 @@ rtl::OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen ) return aRet; } -static NSString* getStandardString( int nButtonId ) +static NSString* getStandardString( int nButtonId, bool bUseResources ) { - rtl::OUString aText( Button::GetStandardText( nButtonId ) ); + rtl::OUString aText; + if( bUseResources ) + { + aText = Button::GetStandardText( nButtonId ); + } if( aText.isEmpty() ) // this is for bad cases, we might be missing the vcl resource { switch( nButtonId ) @@ -127,7 +131,7 @@ static NSString* getStandardString( int nButtonId ) int AquaSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton) + int nDefaultButton, bool bUseResources) { NSString* pTitle = CreateNSString( rTitle ); NSString* pMessage = CreateNSString( rMessage ); @@ -166,11 +170,14 @@ int AquaSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, if( aButtonIds[nC].nDefaultButton == nDefaultButton ) { if( aButtonIds[nC].nTextIds[0] != -1 ) - pDefText = getStandardString( aButtonIds[nC].nTextIds[0] ); + pDefText = getStandardString( + aButtonIds[nC].nTextIds[0], bUseResources ); if( aButtonIds[nC].nTextIds[1] != -1 ) - pAltText = getStandardString( aButtonIds[nC].nTextIds[1] ); + pAltText = getStandardString( + aButtonIds[nC].nTextIds[1], bUseResources ); if( aButtonIds[nC].nTextIds[2] != -1 ) - pOthText = getStandardString( aButtonIds[nC].nTextIds[2] ); + pOthText = getStandardString( + aButtonIds[nC].nTextIds[2], bUseResources ); break; } } diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx index ded4900..4a26a4b 100644 --- a/vcl/generic/app/gensys.cxx +++ b/vcl/generic/app/gensys.cxx @@ -47,6 +47,47 @@ using namespace com::sun::star; +namespace { + +OUString GetNativeMessageBoxButtonText( int nButtonId, bool bUseResources ) +{ + OUString aText; + if( bUseResources ) + { + aText = Button::GetStandardText( nButtonId ); + } + if( aText.isEmpty() ) + { + switch( nButtonId ) + { + case BUTTON_OK: + aText = "OK"; + break; + case BUTTON_CANCEL: + aText = "Cancel"; + break; + case BUTTON_ABORT: + aText = "Abort"; + break; + case BUTTON_RETRY: + aText = "Retry"; + break; + case BUTTON_IGNORE: + aText = "Ignore"; + break; + case BUTTON_YES: + aText = "Yes"; + break; + case BUTTON_NO: + aText = "No"; + break; + } + } + return aText; +} + +} + SalGenericSystem::SalGenericSystem() { } @@ -56,7 +97,8 @@ SalGenericSystem::~SalGenericSystem() } int SalGenericSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, - int nButtonCombination, int nDefaultButton ) + int nButtonCombination, int nDefaultButton, + bool bUseResources ) { int nDefButton = 0; std::list< rtl::OUString > aButtons; @@ -67,15 +109,15 @@ int SalGenericSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const r if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK || nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL ) { - aButtons.push_back( Button::GetStandardText( BUTTON_OK ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_OK, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; } if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL || nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO ) { - aButtons.push_back( Button::GetStandardText( BUTTON_YES ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_YES, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; - aButtons.push_back( Button::GetStandardText( BUTTON_NO ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_NO, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO ) nDefButton = 1; @@ -86,21 +128,21 @@ int SalGenericSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const r { if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL ) { - aButtons.push_back( Button::GetStandardText( BUTTON_RETRY ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; } - aButtons.push_back( Button::GetStandardText( BUTTON_CANCEL ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_CANCEL, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; if( nDefaultButton == SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL ) nDefButton = aButtons.size()-1; } if( nButtonCombination == SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE ) { - aButtons.push_back( Button::GetStandardText( BUTTON_ABORT ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_ABORT, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; - aButtons.push_back( Button::GetStandardText( BUTTON_RETRY ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_RETRY, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; - aButtons.push_back( Button::GetStandardText( BUTTON_IGNORE ) ); + aButtons.push_back( GetNativeMessageBoxButtonText( BUTTON_IGNORE, bUseResources ) ); nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; switch( nDefaultButton ) { diff --git a/vcl/inc/aqua/salsys.h b/vcl/inc/aqua/salsys.h index 6491cab..d352ebb 100644 --- a/vcl/inc/aqua/salsys.h +++ b/vcl/inc/aqua/salsys.h @@ -52,7 +52,7 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); }; diff --git a/vcl/inc/generic/gensys.h b/vcl/inc/generic/gensys.h index abe7fee..eb80bea 100644 --- a/vcl/inc/generic/gensys.h +++ b/vcl/inc/generic/gensys.h @@ -50,7 +50,7 @@ class VCL_DLLPUBLIC SalGenericSystem : public SalSystem virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); // simple helpers primarily for X Windowing W_CLASS hints static const char *getFrameResName(); diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h index 2184d2b..17c831c 100644 --- a/vcl/inc/ios/salsys.h +++ b/vcl/inc/ios/salsys.h @@ -46,7 +46,7 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); }; #endif // _SV_SALSYS_H diff --git a/vcl/inc/salsys.hxx b/vcl/inc/salsys.hxx index 6c9eb37..60b89ad 100644 --- a/vcl/inc/salsys.hxx +++ b/vcl/inc/salsys.hxx @@ -133,6 +133,10 @@ public: The effect of specifying a button that doesn't belong to the specified button combination is undefined. + @param bUseResources + If false, assume initialization of the application failed early and do + not try to access any resources. + @returns the identifier of the button that was pressed by the user. See button identifier above. If the function fails the return value is 0. @@ -140,7 +144,8 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton) = 0; + int nDefaultButton, + bool bUseResources ) = 0; }; SalSystem* ImplGetSalSystem(); diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h index b15c1a7..c70b032 100644 --- a/vcl/inc/win/salsys.h +++ b/vcl/inc/win/salsys.h @@ -76,7 +76,7 @@ public: virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton); + int nDefaultButton, bool bUseResources); bool initMonitors(); // discards monitorinfo; used by WM_DISPLAYCHANGED handler void clearMonitors(); diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx index 02cd644..8501e3f 100644 --- a/vcl/ios/source/app/salsys.cxx +++ b/vcl/ios/source/app/salsys.cxx @@ -106,9 +106,13 @@ rtl::OUString IosSalSystem::GetDisplayScreenName( unsigned int nScreen ) return aRet; } -static NSString* getStandardString( int nButtonId ) +static NSString* getStandardString( int nButtonId, bool bUseResources ) { - rtl::OUString aText( Button::GetStandardText( nButtonId ) ); + rtl::OUString aText; + if( bUseResources ) + { + aText = Button::GetStandardText( nButtonId ); + } if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource { switch( nButtonId ) @@ -150,7 +154,7 @@ static NSString* getStandardString( int nButtonId ) int IosSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, - int nDefaultButton) + int nDefaultButton, bool bUseResources) { NSString* pTitle = CreateNSString( rTitle ); NSString* pMessage = CreateNSString( rMessage ); @@ -189,11 +193,14 @@ int IosSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle, if( aButtonIds[nC].nDefaultButton == nDefaultButton ) { if( aButtonIds[nC].nTextIds[0] != -1 ) - pDefText = getStandardString( aButtonIds[nC].nTextIds[0] ); + pDefText = getStandardString( + aButtonIds[nC].nTextIds[0], bUseResources ); if( aButtonIds[nC].nTextIds[1] != -1 ) - pAltText = getStandardString( aButtonIds[nC].nTextIds[1] ); + pAltText = getStandardString( + aButtonIds[nC].nTextIds[1], bUseResources ); if( aButtonIds[nC].nTextIds[2] != -1 ) - pOthText = getStandardString( aButtonIds[nC].nTextIds[2] ); + pOthText = getStandardString( + aButtonIds[nC].nTextIds[2], bUseResources ); break; } } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index c78bb97..97c987a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1716,7 +1716,7 @@ void Application::ShowNativeErrorBox(const String& sTitle , sTitle, sMessage, SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, false); if (btn != SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK) { OSL_TRACE("ShowNativeMessageBox returned %d", btn); } diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 01a16c8..909626f 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -407,7 +407,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -430,7 +430,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -453,7 +453,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -476,7 +476,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -515,7 +515,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, true); // Do not change the setting in case the user chooses to cancel if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret ) @@ -529,7 +529,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle, ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, - SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK); + SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, true); } } } diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx index b5576c9..0a0dcac 100644 --- a/vcl/win/source/app/salinfo.cxx +++ b/vcl/win/source/app/salinfo.cxx @@ -220,7 +220,7 @@ static int DEFAULT_BTN_MAPPING_TABLE[][8] = { MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1, MB_DEFBUTTON1 } //RETRY_CANCEL }; -int WinSalSystem::ShowNativeMessageBox(const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, int nDefaultButton) +int WinSalSystem::ShowNativeMessageBox(const rtl::OUString& rTitle, const rtl::OUString& rMessage, int nButtonCombination, int nDefaultButton, SAL_UNUSED_PARAMETER bool) { DBG_ASSERT( nButtonCombination >= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK && nButtonCombination <= SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL && commit a0659cc41d7764dd104bce82f8c5b3f0b8073173 Author: Stephan Bergmann <[email protected]> Date: Tue Sep 18 11:51:39 2012 +0200 Enable experimental gtk3 plugin only via SAL_USE_VCLPLUGIN ...and not also via experimental mode, to avoid trying to use the UNO service manager before it has been initialized. Change-Id: Idee8bdccf1193ebe5aa0c47c801f0e2209d57899 diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index 67b806e..133e8c0 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -26,10 +26,6 @@ * ************************************************************************/ -#include "officecfg/Office/Common.hxx" - -#include "comphelper/processfactory.hxx" - #include "osl/module.h" #include "osl/process.h" @@ -55,16 +51,14 @@ static oslModule pCloseModule = NULL; static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = false ) { SalInstance* pInst = NULL; -#if !defined(ANDROID) + // Disable gtk3 plugin for now unless explicitly requested via + // SAL_USE_VCLPLUGIN=gtk3 (would ideally depend on experimental mode, but + // reading the experimental mode setting requires the UNO service manager + // which has not yet been instantiated): if (!bForce && rModuleBase.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("gtk3"))) { - // Disable gtk3 plugin load except in experimental mode for now. - using namespace com::sun::star; - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) - return NULL; + return NULL; } -#endif OUStringBuffer aModName( 128 ); aModName.appendAscii( SAL_DLLPREFIX"vclplug_" ); aModName.append( rModuleBase ); commit e128ec4999d3d7002caa746cb11a29f9f8609f9c Author: Stephan Bergmann <[email protected]> Date: Tue Sep 18 11:42:19 2012 +0200 Use UriReferenceFactory service ctor Change-Id: I6d9af6abdae11d378937c19b7752e3e8517b3de4 diff --git a/avmedia/source/framework/mediaitem.cxx b/avmedia/source/framework/mediaitem.cxx index 591d5db..d3e229d 100644 --- a/avmedia/source/framework/mediaitem.cxx +++ b/avmedia/source/framework/mediaitem.cxx @@ -36,6 +36,7 @@ #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XUriReference.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> @@ -373,10 +374,8 @@ void MediaItem::setZoom( ::com::sun::star::media::ZoomLevel eZoom ) static OUString lcl_GetFilename(OUString const& rSourceURL) { uno::Reference<uri::XUriReferenceFactory> const xUriFactory( - ::comphelper::createProcessComponent( - "com.sun.star.uri.UriReferenceFactory"), - uno::UNO_QUERY_THROW); - + uri::UriReferenceFactory::create( + comphelper::getProcessComponentContext())); uno::Reference<uri::XUriReference> const xSourceURI( xUriFactory->parse(rSourceURL), uno::UNO_SET_THROW); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
