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

New commits:
commit f262e1b1356488515972916c3e11ec210d22cdd9
Author: Pierre-Eric Pelloux-Prayer <pell...@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 <mst...@redhat.com>
    Reviewed-by: Zolnai Tamás <zolnaitamas2...@gmail.com>
    Tested-by: Zolnai Tamás <zolnaitamas2...@gmail.com>
    (cherry picked from commit c7e907f58f8d0791ee304b42de769f43102522e9)

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 
)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to