From 058f03010f53563a2555741c06d84b68e8d2447d Mon Sep 17 00:00:00 2001 From: Kai Ahrens Date: Mon, 14 Dec 2009 07:15:29 +0000 Subject: added community patches --- goodies/source/graphic/grfcache.cxx | 18 ++++++++++++++---- 1 file 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 #include "grfcache.hxx" +#include + // ----------- // - 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 ) -- cgit