diff options
author | Kai Ahrens <ka@openoffice.org> | 2000-12-21 15:49:02 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2000-12-21 15:49:02 +0000 |
commit | 13321559aa2182c4f2c9752cd4bbabc285ebb135 (patch) | |
tree | 08ae70229968a78b93b794273045a4b9d607c191 /goodies | |
parent | 8686f438a4cd0b9efa1a8ebd41452a8f6a393cc8 (diff) |
support for load on demand optimized
Diffstat (limited to 'goodies')
-rw-r--r-- | goodies/inc/grfmgr.hxx | 9 | ||||
-rw-r--r-- | goodies/source/graphic/grfcache.cxx | 6 | ||||
-rw-r--r-- | goodies/source/graphic/grfmgr.cxx | 32 |
3 files changed, 30 insertions, 17 deletions
diff --git a/goodies/inc/grfmgr.hxx b/goodies/inc/grfmgr.hxx index b8ad46e4cef8..b9d126f78e84 100644 --- a/goodies/inc/grfmgr.hxx +++ b/goodies/inc/grfmgr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: grfmgr.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: hr $ $Date: 2000-12-07 14:20:44 $ + * last change: $Author: ka $ $Date: 2000-12-21 16:49:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -255,7 +255,7 @@ private: void ImplConstruct(); void ImplAssignGraphicData(); void ImplSetGraphicManager( const GraphicManager* pMgr, const ByteString* pID = NULL ); - void ImplAutoSwapIn( BOOL bIgnoreSwapState ); + void ImplAutoSwapIn(); BOOL ImplIsAutoSwapped() const { return mbAutoSwapped; } BOOL ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr, PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const; @@ -350,7 +350,8 @@ public: BOOL IsInSwapIn() const { return mbIsInSwapIn; } BOOL IsInSwapOut() const { return mbIsInSwapOut; } BOOL IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); } - BOOL IsSwappedOut() const { return maGraphic.IsSwapOut(); } + BOOL IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); } + void SetSwapState(); BOOL Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD ); diff --git a/goodies/source/graphic/grfcache.cxx b/goodies/source/graphic/grfcache.cxx index 724174c148a3..918369e2b638 100644 --- a/goodies/source/graphic/grfcache.cxx +++ b/goodies/source/graphic/grfcache.cxx @@ -2,9 +2,9 @@ * * $RCSfile: grfcache.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: ka $ $Date: 2000-12-07 14:56:06 $ + * last change: $Author: ka $ $Date: 2000-12-21 16:47:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -607,7 +607,7 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti { BOOL bInserted = FALSE; - if( !rObj.IsSwappedOut() ) + if( !rObj.IsSwappedOut() && ( rObj.GetType() != GRAPHIC_NONE ) ) { GraphicCacheEntry* pEntry = (GraphicCacheEntry*) maGraphicCache.First(); const GraphicID aID( rObj ); diff --git a/goodies/source/graphic/grfmgr.cxx b/goodies/source/graphic/grfmgr.cxx index 3fe4e40b356e..93a629b1bb10 100644 --- a/goodies/source/graphic/grfmgr.cxx +++ b/goodies/source/graphic/grfmgr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: grfmgr.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: ka $ $Date: 2000-12-02 08:38:31 $ + * last change: $Author: ka $ $Date: 2000-12-21 16:48:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -259,9 +259,9 @@ void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const Byt // ----------------------------------------------------------------------------- -void GraphicObject::ImplAutoSwapIn( BOOL bIgnoreSwapState ) +void GraphicObject::ImplAutoSwapIn() { - if( bIgnoreSwapState || IsSwappedOut() ) + if( IsSwappedOut() ) { if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) mbAutoSwapped = FALSE; @@ -579,7 +579,7 @@ Link GraphicObject::GetSwapStreamHdl() const void GraphicObject::FireSwapInRequest() { - ImplAutoSwapIn( TRUE ); + ImplAutoSwapIn(); } // ----------------------------------------------------------------------------- @@ -785,7 +785,7 @@ void GraphicObject::StopAnimation( OutputDevice* pOut, long nExtraData ) const Graphic& GraphicObject::GetGraphic() const { if( mbAutoSwapped ) - ( (GraphicObject*) this )->ImplAutoSwapIn( FALSE ); + ( (GraphicObject*) this )->ImplAutoSwapIn(); return maGraphic; } @@ -803,7 +803,6 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic ) mbAutoSwapped = FALSE; ImplAssignGraphicData(); delete mpLink, mpLink = NULL; - delete mpUserData, mpUserData = NULL; delete mpSimpleCache, mpSimpleCache = NULL; mpMgr->ImplRegisterObj( *this, maGraphic, NULL ); @@ -906,7 +905,7 @@ BOOL GraphicObject::SwapIn() if( mbAutoSwapped ) { - ImplAutoSwapIn( FALSE ); + ImplAutoSwapIn(); bRet = TRUE; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) @@ -933,7 +932,7 @@ BOOL GraphicObject::SwapIn( SvStream* pIStm ) if( mbAutoSwapped ) { - ImplAutoSwapIn( FALSE ); + ImplAutoSwapIn(); bRet = TRUE; } else if( mpMgr && mpMgr->ImplFillSwappedGraphicObject( *this, maGraphic ) ) @@ -954,9 +953,22 @@ BOOL GraphicObject::SwapIn( SvStream* pIStm ) // ----------------------------------------------------------------------------- +void GraphicObject::SetSwapState() +{ + if( !IsSwappedOut() ) + { + mbAutoSwapped = TRUE; + + if( mpMgr ) + mpMgr->ImplGraphicObjectWasSwappedOut( *this ); + } +} + +// ----------------------------------------------------------------------------- + IMPL_LINK( GraphicObject, ImplAutoSwapOutHdl, void*, p ) { - if( !mbAutoSwapped && !IsSwappedOut() ) + if( !IsSwappedOut() ) { mbIsInSwapOut = TRUE; |