summaryrefslogtreecommitdiff
path: root/goodies
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2005-03-08 12:38:48 +0000
committerVladimir Glazounov <vg@openoffice.org>2005-03-08 12:38:48 +0000
commit20b478ff18e095dd7f26459e63a758e4896cf45a (patch)
treeb3ba2aa23de2a0d7fabc14f8948417cd3277c5f2 /goodies
parentbd2690e4044b38f62bc43bdda9bb4208b70297de (diff)
INTEGRATION: CWS swqbugfixes15 (1.17.52); FILE MERGED
2005/02/15 08:41:23 od 1.17.52.1: #i42643# <GraphicObject::ImplDrawTiled(..)> - avoid overflow
Diffstat (limited to 'goodies')
-rw-r--r--goodies/source/graphic/grfmgr2.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/goodies/source/graphic/grfmgr2.cxx b/goodies/source/graphic/grfmgr2.cxx
index cc0792f45065..2937e89ff798 100644
--- a/goodies/source/graphic/grfmgr2.cxx
+++ b/goodies/source/graphic/grfmgr2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: grfmgr2.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: kz $ $Date: 2004-06-11 09:49:31 $
+ * last change: $Author: vg $ $Date: 2005-03-08 13:38:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1869,8 +1869,11 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c
const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() );
bool bRet( false );
+ // #i42643# Casting to Int64, to avoid integer overflow for
+ // huge-DPI output devices
if( GetGraphic().GetType() == GRAPHIC_BITMAP &&
- rSizePixel.Width() * rSizePixel.Height() < nTileCacheSize1D*nTileCacheSize1D )
+ static_cast<sal_Int64>(rSizePixel.Width()) * rSizePixel.Height() <
+ static_cast<sal_Int64>(nTileCacheSize1D)*nTileCacheSize1D )
{
// First combine very small bitmaps into a larger tile
// ===================================================
@@ -1879,7 +1882,8 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c
const int nNumTilesInCacheX( (nTileCacheSize1D + rSizePixel.Width()-1) / rSizePixel.Width() );
const int nNumTilesInCacheY( (nTileCacheSize1D + rSizePixel.Height()-1) / rSizePixel.Height() );
- aVDev.SetOutputSizePixel( Size( nNumTilesInCacheX*rSizePixel.Width(), nNumTilesInCacheY*rSizePixel.Height() ) );
+ aVDev.SetOutputSizePixel( Size( nNumTilesInCacheX*rSizePixel.Width(),
+ nNumTilesInCacheY*rSizePixel.Height() ) );
aVDev.SetMapMode( aMapMode );
// draw bitmap content