Kaydet (Commit) c7e907f5 authored tarafından Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer Kaydeden (comit) Zolnai Tamás

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/14389Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Reviewed-by: 's avatarZolnai Tamás <zolnaitamas2000@gmail.com>
Tested-by: 's avatarZolnai Tamás <zolnaitamas2000@gmail.com>
üst ad14ed0b
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment