diff options
author | Kai Ahrens <ka@openoffice.org> | 2009-12-14 07:15:29 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2009-12-14 07:15:29 +0000 |
commit | 058f03010f53563a2555741c06d84b68e8d2447d (patch) | |
tree | ca6ab6103b89fd27e4e68214d7b96a220e8b61bb | |
parent | f8ada8f2a93659e27928f3b5244c813de2c3847b (diff) |
added community patches
-rw-r--r-- | goodies/source/graphic/grfcache.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/goodies/source/graphic/grfcache.cxx b/goodies/source/graphic/grfcache.cxx index 1a2af16ed741..f0a41ceca53f 100644 --- a/goodies/source/graphic/grfcache.cxx +++ b/goodies/source/graphic/grfcache.cxx @@ -37,6 +37,8 @@ #include <tools/poly.hxx> #include "grfcache.hxx" +#include <memory> + // ----------- // - Defines - // ----------- @@ -612,7 +614,12 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti if( !bInserted ) { GraphicCacheEntry* pEntry = static_cast< GraphicCacheEntry* >( maGraphicCache.First() ); - const GraphicID aID( rObj ); + ::std::auto_ptr< GraphicID > apID; + + if( !pID ) + { + apID.reset( new GraphicID( rObj ) ); + } while( !bInserted && pEntry ) { @@ -647,10 +654,13 @@ void GraphicCache::AddGraphicObject( const GraphicObject& rObj, Graphic& rSubsti } } } - else if( rEntryID == aID ) + else { - pEntry->AddGraphicObjectReference( rObj, rSubstitute ); - bInserted = TRUE; + if( rEntryID == *apID ) + { + pEntry->AddGraphicObjectReference( rObj, rSubstitute ); + bInserted = TRUE; + } } if( !bInserted ) |