summaryrefslogtreecommitdiff
path: root/svtools/source/graphic/grfcache.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 11:26:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 11:54:12 +0100
commit1ae61b0ac4187b2938647f3ca0289a070a5dc7d2 (patch)
tree9461c0532919f4fe61f3e0e3fa8556e954244fbd /svtools/source/graphic/grfcache.cxx
parent04bb9549e0a0ee567f3bd48a7707286c5abd631a (diff)
loplugin:flatten in svtools
almost completely automatically rewritten, only had to tweak the indentation on a couple of lines. Change-Id: Ieec92e5b602d180d7ec556e3421ce3c835c1f646 Reviewed-on: https://gerrit.libreoffice.org/45072 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/graphic/grfcache.cxx')
-rw-r--r--svtools/source/graphic/grfcache.cxx52
1 files changed, 26 insertions, 26 deletions
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 1f99b841cea8..da41b631fc93 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -372,19 +372,19 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut()
if( !maGraphicObjectList[ i ]->IsSwappedOut() )
mbSwappedAll = false;
- if( mbSwappedAll )
- {
- delete mpBmpEx;
- mpBmpEx = nullptr;
- delete mpMtf;
- mpMtf = nullptr;
- delete mpAnimation;
- mpAnimation = nullptr;
-
- // #119176# also reset VectorGraphicData
- maVectorGraphicData.reset();
- maPdfData = uno::Sequence<sal_Int8>();
- }
+ if( !mbSwappedAll )
+ return;
+
+ delete mpBmpEx;
+ mpBmpEx = nullptr;
+ delete mpMtf;
+ mpMtf = nullptr;
+ delete mpAnimation;
+ mpAnimation = nullptr;
+
+ // #119176# also reset VectorGraphicData
+ maVectorGraphicData.reset();
+ maPdfData = uno::Sequence<sal_Int8>();
}
void GraphicCacheEntry::GraphicObjectWasSwappedIn( const GraphicObject& rObj )
@@ -1019,21 +1019,21 @@ void GraphicCache::SetMaxDisplayCacheSize( sal_uLong nNewCacheSize )
void GraphicCache::SetCacheTimeout( sal_uLong nTimeoutSeconds )
{
- if( mnReleaseTimeoutSeconds != nTimeoutSeconds )
- {
- ::salhelper::TTimeValue aReleaseTime;
+ if( mnReleaseTimeoutSeconds == nTimeoutSeconds )
+ return;
- if( ( mnReleaseTimeoutSeconds = nTimeoutSeconds ) != 0 )
- {
- osl_getSystemTime( &aReleaseTime );
- aReleaseTime.addTime( ::salhelper::TTimeValue( nTimeoutSeconds, 0 ) );
- }
+ ::salhelper::TTimeValue aReleaseTime;
- for( GraphicDisplayCacheEntryVector::const_iterator it = maDisplayCache.begin();
- it != maDisplayCache.end(); ++it )
- {
- (*it)->SetReleaseTime( aReleaseTime );
- }
+ if( ( mnReleaseTimeoutSeconds = nTimeoutSeconds ) != 0 )
+ {
+ osl_getSystemTime( &aReleaseTime );
+ aReleaseTime.addTime( ::salhelper::TTimeValue( nTimeoutSeconds, 0 ) );
+ }
+
+ for( GraphicDisplayCacheEntryVector::const_iterator it = maDisplayCache.begin();
+ it != maDisplayCache.end(); ++it )
+ {
+ (*it)->SetReleaseTime( aReleaseTime );
}
}