summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pelloux@gmail.com>2015-02-08 18:31:28 +0100
committerZolnai Tamás <zolnaitamas2000@gmail.com>2015-02-09 21:21:47 +0000
commitc7e907f58f8d0791ee304b42de769f43102522e9 (patch)
tree29d9a4ba64a41511f6bda4d7d25aa5771d95e07d /svtools
parentad14ed0bbf80dd95dca6e0dea6edbe5fb68f9f26 (diff)
svtool/GraphicManager: properly decrease mnUsedSize on unregister ops
mnUsedSize was never decreased causing the cache to pretending to be full, which caused lots of needless work (image loading, id creation (which are basically a crc of all bytes of an image, ...)) Change-Id: I1e0a6a07631435346c3509822fae43a067d33303 Reviewed-on: https://gerrit.libreoffice.org/14389 Reviewed-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Zolnai Tamás <zolnaitamas2000@gmail.com> Tested-by: Zolnai Tamás <zolnaitamas2000@gmail.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/grfmgr2.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index f4696234e9f9..3aabb528f3b0 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -167,12 +167,13 @@ void GraphicManager::ImplUnregisterObj( const GraphicObject& rObj )
{
if ( *it == &rObj ) {
maObjList.erase( it );
+
+ if( !rObj.IsSwappedOut() )
+ mnUsedSize -= rObj.GetSizeBytes();
return;
}
}
assert(false); // surely it should have been registered?
- if( !rObj.IsSwappedOut() )
- mnUsedSize -= rObj.GetSizeBytes();
}
void GraphicManager::ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj )