[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - toolkit/source vcl/source
Caolán McNamara
caolanm at redhat.com
Tue Jun 16 01:00:07 PDT 2015
toolkit/source/awt/vclxtoolkit.cxx | 22 +++++++++++++++++++++-
vcl/source/app/svapp.cxx | 3 ++-
2 files changed, 23 insertions(+), 2 deletions(-)
New commits:
commit 4b73386f06f9cea4a23f7e0a0882540e3dd4aa0a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 4 10:06:17 2015 +0100
Resolves: tdf#46440 SIGSEGV on toolkit bootstrap without running instance
(cherry picked from commit 3f69547397e5841d0915921be5be8b3edfdfdbc5)
Change-Id: I9a78a75b3d72586b1702ed6fa63bb0b62ce6cd72
Reviewed-on: https://gerrit.libreoffice.org/16078
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 680fc0c..4cc5873 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>
@@ -601,7 +602,26 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
{
osl_setThreadName("VCLXToolkit VCL main thread");
- VCLXToolkit * pTk = (VCLXToolkit *)pArgs;
+ 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 )
{
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 8d99977..5ce9477 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -428,7 +428,8 @@ void Application::AcquireSolarMutex( sal_uLong nCount )
bool Application::IsInMain()
{
- return ImplGetSVData()->maAppData.mbInAppMain;
+ ImplSVData* pSVData = ImplGetSVData();
+ return pSVData ? pSVData->maAppData.mbInAppMain : false;
}
bool Application::IsInExecute()
More information about the Libreoffice-commits
mailing list