[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - toolkit/source vcl/source
Caolán McNamara
caolanm at redhat.com
Thu Jun 4 03:13:47 PDT 2015
toolkit/source/awt/vclxtoolkit.cxx | 20 ++++++++++++++++++++
vcl/source/app/svapp.cxx | 3 ++-
2 files changed, 22 insertions(+), 1 deletion(-)
New commits:
commit 7d8383fb96a71e8ff2a5991c24dc36d82357207f
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
Change-Id: I9a78a75b3d72586b1702ed6fa63bb0b62ce6cd72
(cherry picked from commit 3f69547397e5841d0915921be5be8b3edfdfdbc5)
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 5962c95..edf624a 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 )
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 4edae11..fc058ce 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -418,7 +418,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