summaryrefslogtreecommitdiff
path: root/svtools/source/graphic/grfmgr2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/graphic/grfmgr2.cxx')
-rw-r--r--svtools/source/graphic/grfmgr2.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 3aabb528f3b0..0c4e17b66b30 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -157,19 +157,21 @@ void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubst
maObjList.push_back( (GraphicObject*)&rObj );
mpCache->AddGraphicObject( rObj, rSubstitute, pID, pCopyObj );
if( !rObj.IsSwappedOut() )
- mnUsedSize += rObj.GetSizeBytes();
+ mnUsedSize += rObj.maGraphic.GetSizeBytes();
}
void GraphicManager::ImplUnregisterObj( const GraphicObject& rObj )
{
mpCache->ReleaseGraphicObject( rObj );
+ if( !rObj.IsSwappedOut() )
+ {
+ assert(mnUsedSize >= rObj.maGraphic.GetSizeBytes());
+ mnUsedSize -= rObj.maGraphic.GetSizeBytes();
+ }
for( GraphicObjectList_impl::iterator it = maObjList.begin(); it != maObjList.end(); ++it )
{
if ( *it == &rObj ) {
maObjList.erase( it );
-
- if( !rObj.IsSwappedOut() )
- mnUsedSize -= rObj.GetSizeBytes();
return;
}
}
@@ -179,6 +181,7 @@ void GraphicManager::ImplUnregisterObj( const GraphicObject& rObj )
void GraphicManager::ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj )
{
mpCache->GraphicObjectWasSwappedOut( rObj );
+ assert(mnUsedSize >= rObj.GetSizeBytes());
mnUsedSize -= rObj.GetSizeBytes();
}
@@ -236,15 +239,10 @@ void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const GraphicObject* pGrap
}
}
-bool GraphicManager::ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute )
-{
- return mpCache->FillSwappedGraphicObject(rObj, rSubstitute);
-}
-
void GraphicManager::ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj )
{
mpCache->GraphicObjectWasSwappedIn( rObj );
- mnUsedSize += rObj.GetSizeBytes();
+ mnUsedSize += rObj.maGraphic.GetSizeBytes();
}
bool GraphicManager::ImplDraw( OutputDevice* pOut, const Point& rPt,