diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-09 15:49:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-10 10:37:57 +0000 |
commit | 7aaa217894fad1b3fd5c06cc77a216a87adae93d (patch) | |
tree | 971d0dcc50e4d0597de2f5ba1707f2a63f6b4797 /svtools | |
parent | e7b1aeb2943bf8fb986e712b200ebe346a4b67ad (diff) |
collapse !mpMgr || mpMgr
Change-Id: Id93b2da5665c47b1e8941d2f7428fe078c6227f7
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/graphic/grfmgr.cxx | 73 |
1 files changed, 35 insertions, 38 deletions
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 ); } } |