From 7aaa217894fad1b3fd5c06cc77a216a87adae93d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 9 Jan 2017 15:49:10 +0000 Subject: collapse !mpMgr || mpMgr Change-Id: Id93b2da5665c47b1e8941d2f7428fe078c6227f7 --- svtools/source/graphic/grfmgr.cxx | 73 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 38 deletions(-) (limited to 'svtools') diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index d0e27c408d80..8507c009bc9d 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 ); } } -- cgit