From ade93a6e213abbb768f91cc839cd0ffe25934b9b Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Wed, 22 Mar 2006 09:19:57 +0000 Subject: INTEGRATION: CWS vcl55 (1.16.194); FILE MERGED 2006/03/14 09:13:20 hdu 1.16.194.1: #131856# check mapmode enumerator before use --- vcl/source/gdi/outmap.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx index 0da54c37f67c..88a11c61683c 100644 --- a/vcl/source/gdi/outmap.cxx +++ b/vcl/source/gdi/outmap.cxx @@ -4,9 +4,9 @@ * * $RCSfile: outmap.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: rt $ $Date: 2005-09-09 12:07:42 $ + * last change: $Author: obo $ $Date: 2006-03-22 10:19:57 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1713,10 +1713,17 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion, // ----------------------------------------------------------------------- #define ENTER3( eUnitSource, eUnitDest ) \ - long nNumerator = aImplNumeratorAry[eUnitSource] * \ + long nNumerator = 1; \ + long nDenominator = 1; \ + DBG_ASSERT( eUnitSource < MAP_LASTENUMDUMMY, "Invalid source map unit"); \ + DBG_ASSERT( eUnitDest < MAP_LASTENUMDUMMY, "Invalid destination map unit"); \ + if( (eUnitSource < MAP_LASTENUMDUMMY) && (eUnitDest < MAP_LASTENUMDUMMY) ) \ + { \ + nNumerator = aImplNumeratorAry[eUnitSource] * \ aImplDenominatorAry[eUnitDest]; \ - long nDenominator = aImplNumeratorAry[eUnitDest] * \ + nDenominator = aImplNumeratorAry[eUnitDest] * \ aImplDenominatorAry[eUnitSource]; \ + } \ if ( eUnitSource == MAP_PIXEL ) \ nDenominator *= 72; \ else if( eUnitDest == MAP_PIXEL ) \ -- cgit