diff options
author | Kai Ahrens <ka@openoffice.org> | 2002-07-30 11:58:13 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2002-07-30 11:58:13 +0000 |
commit | 174fdeb00358d0e4c2d94bf3407e605b7bfb032d (patch) | |
tree | 39b298a29d942007d1c4f5ee9db65468798bc0c1 /goodies/source/graphic | |
parent | ea98c6fb8cb31555a679bd8c931458433d261817 (diff) |
#100983#: added assertionsto recognize missing graphics
Diffstat (limited to 'goodies/source/graphic')
-rw-r--r-- | goodies/source/graphic/grfcache.cxx | 5 | ||||
-rw-r--r-- | goodies/source/graphic/grfmgr.cxx | 52 |
2 files changed, 34 insertions, 23 deletions
diff --git a/goodies/source/graphic/grfcache.cxx b/goodies/source/graphic/grfcache.cxx index b6968892f21b..f7a43053985a 100644 --- a/goodies/source/graphic/grfcache.cxx +++ b/goodies/source/graphic/grfcache.cxx @@ -2,9 +2,9 @@ * * $RCSfile: grfcache.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: ka $ $Date: 2002-05-31 09:01:11 $ + * last change: $Author: ka $ $Date: 2002-07-30 12:58:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -280,6 +280,7 @@ BOOL GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) break; default: + DBG_ASSERT( GetID().IsEmpty(), "GraphicCacheEntry::ImplInit: Could not initialize graphic! (=>KA)" ); break; } diff --git a/goodies/source/graphic/grfmgr.cxx b/goodies/source/graphic/grfmgr.cxx index 355266075365..511a5d7aa520 100644 --- a/goodies/source/graphic/grfmgr.cxx +++ b/goodies/source/graphic/grfmgr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: grfmgr.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: ka $ $Date: 2002-05-22 11:50:41 $ + * last change: $Author: ka $ $Date: 2002-07-30 12:58:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -275,37 +275,47 @@ void GraphicObject::ImplAutoSwapIn() { mbIsInSwapIn = TRUE; - SvStream* pStream = GetSwapStream(); - - if( GRFMGR_AUTOSWAPSTREAM_NONE != pStream ) + if( maGraphic.SwapIn() ) + mbAutoSwapped = FALSE; + else { - if( GRFMGR_AUTOSWAPSTREAM_LINK == pStream ) + SvStream* pStream = GetSwapStream(); + + if( GRFMGR_AUTOSWAPSTREAM_NONE != pStream ) { - if( HasLink() ) + if( GRFMGR_AUTOSWAPSTREAM_LINK == pStream ) { - String aURLStr; - - if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( GetLink(), aURLStr ) ) + if( HasLink() ) { - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_READ ); + String aURLStr; - if( pIStm ) + if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( GetLink(), aURLStr ) ) { - (*pIStm) >> maGraphic; - mbAutoSwapped = ( maGraphic.GetType() != GRAPHIC_NONE ); - delete pIStm; + SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURLStr, STREAM_READ ); + + if( pIStm ) + { + (*pIStm) >> maGraphic; + mbAutoSwapped = ( maGraphic.GetType() != GRAPHIC_NONE ); + delete pIStm; + } } } } + else if( GRFMGR_AUTOSWAPSTREAM_TEMP == pStream ) + mbAutoSwapped = !maGraphic.SwapIn(); + else if( GRFMGR_AUTOSWAPSTREAM_LOADED == pStream ) + mbAutoSwapped = maGraphic.IsSwapOut(); + else + { + mbAutoSwapped = !maGraphic.SwapIn( pStream ); + delete pStream; + } } - else if( GRFMGR_AUTOSWAPSTREAM_TEMP == pStream ) - mbAutoSwapped = !maGraphic.SwapIn(); - else if( GRFMGR_AUTOSWAPSTREAM_LOADED == pStream ) - mbAutoSwapped = maGraphic.IsSwapOut(); else { - mbAutoSwapped = !maGraphic.SwapIn( pStream ); - delete pStream; + DBG_ASSERT( ( GRAPHIC_NONE == meType ) || ( GRAPHIC_DEFAULT == meType ), + "GraphicObject::ImplAutoSwapIn: could not get stream to swap in graphic! (=>KA)" ); } } |