summaryrefslogtreecommitdiff
path: root/goodies/source
diff options
context:
space:
mode:
authorKai Ahrens <ka@openoffice.org>2001-04-10 15:06:27 +0000
committerKai Ahrens <ka@openoffice.org>2001-04-10 15:06:27 +0000
commitebd947a950ee2acf7d9a0f07a6a7424f2a4cfbd3 (patch)
tree2c6cde38912d78265ddcf56e22e2c7b80a496de5 /goodies/source
parent0234d1511ac76b2c2294d7fe9d1fef353bf1bc3b (diff)
#85972#: force swap in of graphic objects when unique id is requested
Diffstat (limited to 'goodies/source')
-rw-r--r--goodies/source/graphic/grfcache.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/goodies/source/graphic/grfcache.cxx b/goodies/source/graphic/grfcache.cxx
index 3a554ea9eefd..2f512d3224a0 100644
--- a/goodies/source/graphic/grfcache.cxx
+++ b/goodies/source/graphic/grfcache.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: grfcache.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: ka $ $Date: 2001-03-02 12:41:50 $
+ * last change: $Author: ka $ $Date: 2001-04-10 16:06:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -783,7 +783,20 @@ BOOL GraphicCache::IsInDisplayCache( OutputDevice* pOut, const Point& rPt, const
ByteString GraphicCache::GetUniqueID( const GraphicObject& rObj ) const
{
- return( ( (GraphicCache*) this )->ImplGetCacheEntry( rObj )->GetID().GetIDString() );
+ ByteString aRet;
+ GraphicCacheEntry* pEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj );
+
+ // ensure that the entry is correctly initialized (it has to be read at least once)
+ if( pEntry && !pEntry->IsInitialized() )
+ pEntry->TryToSwapIn();
+
+ // do another call to ImplGetCacheEntry in case of modified entry list
+ pEntry = ( (GraphicCache*) this )->ImplGetCacheEntry( rObj );
+
+ if( pEntry )
+ aRet = pEntry->GetID().GetIDString();
+
+ return aRet;
}
// -----------------------------------------------------------------------------