summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-04 10:06:17 +0100
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:21:51 +0200
commit955c2cbf64a751d6f7d41f6e2e58eca5e95ed213 (patch)
tree5cbfde4b5ffa7cb61ea096e82d0f23f808087dbf /toolkit
parent4e1d190f2b04bafe510cda9c54974898993c09df (diff)
Resolves: tdf#46440 SIGSEGV on toolkit bootstrap without running instance
Change-Id: I9a78a75b3d72586b1702ed6fa63bb0b62ce6cd72 (cherry picked from commit 3f69547397e5841d0915921be5be8b3edfdfdbc5)
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 5962c95a5647..edf624a0f4bd 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 )