summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-09 15:49:10 +0000
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:17:38 -0500
commit9b8ae827fd21a5132aae84830850d1373af0b442 (patch)
tree6af0da7d6b24ac7f840a341b951e73b36ee6341e /svtools
parent2bd14132fc324506de8310401ced77f26e5415da (diff)
collapse !mpMgr || mpMgr
Change-Id: Id93b2da5665c47b1e8941d2f7428fe078c6227f7 (cherry picked from commit 7aaa217894fad1b3fd5c06cc77a216a87adae93d) (cherry picked from commit a5fd6e0d34db092c89e0fd7a0be210705dcc7735)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/grfmgr.cxx73
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 );
}
}