summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-09 15:50:56 +0000
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:17:38 -0500
commitd761953d4f4b7588a55b4a2e5be33ed7c4c1fe68 (patch)
tree12fd01dded583142d7a1bcbb657f5a39bf0b4fc1 /svtools
parent9b8ae827fd21a5132aae84830850d1373af0b442 (diff)
the only GraphicManager is the mpGlobalMgr, so simplify accordingly
Change-Id: I5b237e27815e138cdcab75b1b9f657882ae8a37b (cherry picked from commit 6b0ae6c674e0216bc916232e500515f9eb764664) (cherry picked from commit 27b3043ac1d125e48fbb857282759d67acf1b2b6)
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/grfmgr.cxx53
1 files changed, 18 insertions, 35 deletions
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 8507c009bc9d..2577393465e1 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -163,51 +163,34 @@ void GraphicObject::ImplAssignGraphicData()
void GraphicObject::ImplSetGraphicManager(const OString* pID, const GraphicObject* pCopyObj)
{
- if (mpMgr && mpMgr == mpGlobalMgr)
+ if (mpMgr)
return;
else
{
- if( mpMgr )
+ if( !mpGlobalMgr )
{
- mpMgr->ImplUnregisterObj( *this );
-
- if( ( mpMgr == mpGlobalMgr ) && !mpGlobalMgr->ImplHasObjects() )
+ if (!utl::ConfigManager::IsAvoidConfig())
{
- delete mpGlobalMgr;
- mpGlobalMgr = nullptr;
+ 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());
}
- }
-
- if (true)
- {
- if( !mpGlobalMgr )
+ else
{
- 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(
+ 20000,
+ 20000);
+ mpGlobalMgr->SetCacheTimeout(
+ 20000);
}
-
- mpMgr = mpGlobalMgr;
}
- else
- mpMgr = nullptr;
+ mpMgr = mpGlobalMgr;
mpMgr->ImplRegisterObj( *this, maGraphic, pID, pCopyObj );
}
}