[Libreoffice-commits] core.git: svtools/source

Caolán McNamara caolanm at redhat.com
Tue Jan 10 10:38:44 UTC 2017


 svtools/source/graphic/grfmgr.cxx |   73 ++++++++++++++++++--------------------
 1 file changed, 35 insertions(+), 38 deletions(-)

New commits:
commit 7aaa217894fad1b3fd5c06cc77a216a87adae93d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 9 15:49:10 2017 +0000

    collapse !mpMgr || mpMgr
    
    Change-Id: Id93b2da5665c47b1e8941d2f7428fe078c6227f7

diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index d0e27c4..8507c00 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -163,55 +163,52 @@ void GraphicObject::ImplAssignGraphicData()
 
 void GraphicObject::ImplSetGraphicManager(const OString* pID, const GraphicObject* pCopyObj)
 {
-    if (!mpMgr || mpMgr)
+    if (mpMgr && mpMgr == mpGlobalMgr)
+        return;
+    else
     {
-        if (mpMgr && mpMgr == mpGlobalMgr)
-            return;
-        else
+        if( mpMgr )
         {
-            if( mpMgr )
-            {
-                mpMgr->ImplUnregisterObj( *this );
+            mpMgr->ImplUnregisterObj( *this );
 
-                if( ( mpMgr == mpGlobalMgr ) && !mpGlobalMgr->ImplHasObjects() )
-                {
-                    delete mpGlobalMgr;
-                    mpGlobalMgr = nullptr;
-                }
+            if( ( mpMgr == mpGlobalMgr ) && !mpGlobalMgr->ImplHasObjects() )
+            {
+                delete mpGlobalMgr;
+                mpGlobalMgr = nullptr;
             }
+        }
 
-            if (true)
+        if (true)
+        {
+            if( !mpGlobalMgr )
             {
-                if( !mpGlobalMgr )
+                if (!utl::ConfigManager::IsAvoidConfig())
                 {
-                    if (!utl::ConfigManager::IsAvoidConfig())
-                    {
-                        mpGlobalMgr = new GraphicManager(
-                            (officecfg::Office::Common::Cache::GraphicManager::
-                             TotalCacheSize::get()),
-                            (officecfg::Office::Common::Cache::GraphicManager::
-                             ObjectCacheSize::get()));
-                        mpGlobalMgr->SetCacheTimeout(
-                            officecfg::Office::Common::Cache::GraphicManager::
-                            ObjectReleaseTime::get());
-                    }
-                    else
-                    {
-                        mpGlobalMgr = new GraphicManager(
-                            20000,
-                            20000);
-                        mpGlobalMgr->SetCacheTimeout(
-                            20000);
-                    }
+                    mpGlobalMgr = new GraphicManager(
+                        (officecfg::Office::Common::Cache::GraphicManager::
+                         TotalCacheSize::get()),
+                        (officecfg::Office::Common::Cache::GraphicManager::
+                         ObjectCacheSize::get()));
+                    mpGlobalMgr->SetCacheTimeout(
+                        officecfg::Office::Common::Cache::GraphicManager::
+                        ObjectReleaseTime::get());
+                }
+                else
+                {
+                    mpGlobalMgr = new GraphicManager(
+                        20000,
+                        20000);
+                    mpGlobalMgr->SetCacheTimeout(
+                        20000);
                 }
-
-                mpMgr = mpGlobalMgr;
             }
-            else
-                mpMgr = nullptr;
 
-            mpMgr->ImplRegisterObj( *this, maGraphic, pID, pCopyObj );
+            mpMgr = mpGlobalMgr;
         }
+        else
+            mpMgr = nullptr;
+
+        mpMgr->ImplRegisterObj( *this, maGraphic, pID, pCopyObj );
     }
 }
 


More information about the Libreoffice-commits mailing list