[Libreoffice-commits] core.git: 3 commits - vcl/source

Tor Lillqvist tml at collabora.com
Mon Feb 15 20:56:45 UTC 2016


 vcl/source/app/svmain.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit b3e8406f53e29e4401d24b8aaa3020766cc61f02
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 15 22:47:25 2016 +0200

    loplugin:nullptr
    
    Change-Id: I8dafbf99638fd24828327ce4493bfbbf1b9d2c6d

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 0f329e604..f59f5f9 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -244,9 +244,9 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const OUString& Nam
 static bool isInitVCL()
 {
     ImplSVData* pSVData = ImplGetSVData();
-    return  pExceptionHandler != NULL &&
-            pSVData->mpApp != NULL &&
-            pSVData->mpDefInst != NULL;
+    return  pExceptionHandler != nullptr &&
+            pSVData->mpApp != nullptr &&
+            pSVData->mpDefInst != nullptr;
 }
 
 bool InitVCL()
commit b07fd644bab69fb19c58e6dae394e963a463d2e1
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 15 22:45:33 2016 +0200

    loplugin:simplifybool
    
    conditional expression of the form '!A ? B : true' (with A of type
    'bool' and B of type 'bool') can literally be simplified as 'A || B'.
    
    Change-Id: I46bee836425bf1c76def23e30dca9ddd9e791b42

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 2eb36ef..0f329e604 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -158,7 +158,7 @@ int ImplSVMain()
 
     int nReturn = EXIT_FAILURE;
 
-    bool bInit = (!isInitVCL() ? InitVCL() : true);
+    bool bInit = isInitVCL() || InitVCL();
 
     if( bInit )
     {
commit bc8dfe47596f28ff43ec01af4487a2abe349caee
Author: Henry Castro <hcastro at collabora.com>
Date:   Mon Sep 7 17:33:09 2015 -0400

    vcl: add isInitVCL, to not initialize twice
    
    In the preinit stage, the VCL is initialized in the parent process
    and when the lo_startmain thread is started, the thread initialize
    VCL again.
    
    It is not necessary to initialize twice.
    
    Change-Id: I819cf0125afe7760c3f4d91c420d36a3a383902c

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index eba0c10..2eb36ef 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -92,6 +92,8 @@
 
 using namespace ::com::sun::star;
 
+static bool isInitVCL();
+
 oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo)
 {
     static bool bIn = false;
@@ -156,7 +158,7 @@ int ImplSVMain()
 
     int nReturn = EXIT_FAILURE;
 
-    bool bInit = InitVCL();
+    bool bInit = (!isInitVCL() ? InitVCL() : true);
 
     if( bInit )
     {
@@ -239,6 +241,14 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const OUString& Nam
     return retVal;
 }
 
+static bool isInitVCL()
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    return  pExceptionHandler != NULL &&
+            pSVData->mpApp != NULL &&
+            pSVData->mpDefInst != NULL;
+}
+
 bool InitVCL()
 {
     if( pExceptionHandler != nullptr )


More information about the Libreoffice-commits mailing list