summaryrefslogtreecommitdiff
path: root/goodies
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-04-18 08:22:36 +0000
committerOliver Bolte <obo@openoffice.org>2005-04-18 08:22:36 +0000
commitfd539a6d02fd7a68ad6a1d26c32644c0eb0838f2 (patch)
tree117d3f01913116499974c9cc56d8a75cdffbb5a7 /goodies
parent5c22a3f129b5596c0ecb8fd8c211ab11d5f3c22e (diff)
INTEGRATION: CWS presfixes03 (1.16.42); FILE MERGED
2005/04/14 12:08:54 thb 1.16.42.1: #i46805# The GraphicCache errorneously used a cached bitmap, prepared for a monochrome VDev with draw mode BLACKBITMAP, for normal output. Fixed by a) ruling out BLACK/WHITE_BITMAP for caching at all, and b) storing both bit depth and draw mode of target outdev in the DisplayCacheEntry
Diffstat (limited to 'goodies')
-rw-r--r--goodies/source/graphic/grfcache.cxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/goodies/source/graphic/grfcache.cxx b/goodies/source/graphic/grfcache.cxx
index 99cb739233cb..4c8da945611d 100644
--- a/goodies/source/graphic/grfcache.cxx
+++ b/goodies/source/graphic/grfcache.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: grfcache.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: hr $ $Date: 2004-09-09 11:35:11 $
+ * last change: $Author: obo $ $Date: 2005-04-18 09:22:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -445,6 +445,8 @@ private:
GraphicAttr maAttr;
Size maOutSizePix;
ULONG mnCacheSize;
+ ULONG mnOutDevDrawMode;
+ USHORT mnOutDevBitCount;
public:
@@ -460,7 +462,9 @@ public:
mpRefCacheEntry( pRefCacheEntry ),
mpMtf( NULL ), mpBmpEx( new BitmapEx( rBmpEx ) ),
maAttr( rAttr ), maOutSizePix( pOut->LogicToPixel( rSz ) ),
- mnCacheSize( GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) )
+ mnCacheSize( GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) ),
+ mnOutDevDrawMode( pOut->GetDrawMode() ),
+ mnOutDevBitCount( pOut->GetBitCount() )
{
}
@@ -471,7 +475,9 @@ public:
mpRefCacheEntry( pRefCacheEntry ),
mpMtf( new GDIMetaFile( rMtf ) ), mpBmpEx( NULL ),
maAttr( rAttr ), maOutSizePix( pOut->LogicToPixel( rSz ) ),
- mnCacheSize( GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) )
+ mnCacheSize( GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) ),
+ mnOutDevDrawMode( pOut->GetDrawMode() ),
+ mnOutDevBitCount( pOut->GetBitCount() )
{
}
@@ -482,6 +488,8 @@ public:
const Size& GetOutputSizePixel() const { return maOutSizePix; }
const ULONG GetCacheSize() const { return mnCacheSize; }
const GraphicCacheEntry* GetReferencedCacheEntry() const { return mpRefCacheEntry; }
+ const ULONG GetOutDevDrawMode() const { return mnOutDevDrawMode; }
+ const USHORT GetOutDevBitCount() const { return mnOutDevBitCount; }
void SetReleaseTime( const ::vos::TTimeValue& rReleaseTime ) { maReleaseTime = rReleaseTime; }
const ::vos::TTimeValue& GetReleaseTime() const { return maReleaseTime; }
@@ -489,9 +497,17 @@ public:
BOOL Matches( OutputDevice* pOut, const Point& rPtPixel, const Size& rSzPixel,
const GraphicCacheEntry* pCacheEntry, const GraphicAttr& rAttr ) const
{
+ // #i46805# Additional match
+ // criteria: outdev draw mode and
+ // bit count. One cannot reuse
+ // this cache object, if it's
+ // e.g. generated for
+ // DRAWMODE_GRAYBITMAP.
return( ( pCacheEntry == mpRefCacheEntry ) &&
( maAttr == rAttr ) &&
- ( ( maOutSizePix == rSzPixel ) || ( !maOutSizePix.Width() && !maOutSizePix.Height() ) ) );
+ ( ( maOutSizePix == rSzPixel ) || ( !maOutSizePix.Width() && !maOutSizePix.Height() ) ) &&
+ ( pOut->GetBitCount() == mnOutDevBitCount ) &&
+ ( pOut->GetDrawMode() == mnOutDevDrawMode ) );
}
void Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz ) const;