diff options
Diffstat (limited to 'toolkit/source/awt')
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 874515736437..642c636631dc 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/awt/XToolkitExperimental.hpp> #include <com/sun/star/awt/XMessageBoxFactory.hpp> +#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/compbase2.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/supportsservice.hxx> @@ -595,6 +596,25 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs ) { osl_setThreadName("VCLXToolkit VCL main thread"); + css::uno::Reference<css::lang::XMultiServiceFactory> xServiceManager; + try + { + xServiceManager = ::comphelper::getProcessServiceFactory(); + } + catch (const css::uno::DeploymentException&) + { + } + if (!xServiceManager.is()) + { + css::uno::Reference<css::uno::XComponentContext> xContext = + ::cppu::defaultBootstrap_InitialComponentContext(); + + xServiceManager = css::uno::Reference<css::lang::XMultiServiceFactory>( + xContext->getServiceManager(), css::uno::UNO_QUERY_THROW ); + // set global process service factory used by unotools config helpers + ::comphelper::setProcessServiceFactory( xServiceManager ); + } + VCLXToolkit * pTk = static_cast<VCLXToolkit *>(pArgs); bInitedByVCLToolkit = InitVCL(); if( bInitedByVCLToolkit ) |