[Libreoffice-commits] core.git: svtools/source

Pierre-Eric Pelloux-Prayer pelloux at gmail.com
Mon Feb 9 13:22:11 PST 2015


 svtools/source/graphic/grfmgr2.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c7e907f58f8d0791ee304b42de769f43102522e9
Author: Pierre-Eric Pelloux-Prayer <pelloux at gmail.com>
Date:   Sun Feb 8 18:31:28 2015 +0100

    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 at redhat.com>
    Reviewed-by: Zolnai Tamás <zolnaitamas2000 at gmail.com>
    Tested-by: Zolnai Tamás <zolnaitamas2000 at gmail.com>

diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index f469623..3aabb52 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 )


More information about the Libreoffice-commits mailing list