summaryrefslogtreecommitdiff
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-10 00:40:09 +0100
commitf262e1b1356488515972916c3e11ec210d22cdd9 (patch)
treef3355fb719d4c25e0872260c3ef77d402cdfc86d
parent21f65ba8e3f30b12a0cddda01f89e7bbe7e7850c (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> (cherry picked from commit c7e907f58f8d0791ee304b42de769f43102522e9)
-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 )