diff options
author | Michael Stahl <mst@openoffice.org> | 2012-07-27 17:31:08 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-27 17:50:22 +0200 |
commit | 6a94d7b5c924e3a8ef3ff0f68f54061c035a3cb0 (patch) | |
tree | d042709f848a900386493db45c687679e79eaa0c /vcl | |
parent | 89f08dce89adfddd3fb8e00b7a7a9c5da2a4943e (diff) |
basic, cui, extensions, filter, vcl: fix some warnings
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/metric.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/outmap.cxx | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx index a523b414ee89..bb9673ccbc98 100644 --- a/vcl/source/gdi/metric.cxx +++ b/vcl/source/gdi/metric.cxx @@ -714,7 +714,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) while( cMin < cEnd ) { int j = 0; - for(; (cMin < cEnd) && (j < NINSIZE); ++cMin ) + for (; (cMin < cEnd) && (j < (NINSIZE-1)); ++cMin) { if( cMin >= 0x0100 ) cCharsInp[ j++ ] = static_cast<sal_Char>(cMin >> 8); diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx index 42e96c2e068a..284f473d1c5d 100644 --- a/vcl/source/gdi/outmap.cxx +++ b/vcl/source/gdi/outmap.cxx @@ -61,9 +61,10 @@ DBG_NAMEEX( Region ) // ======================================================================= -static long aImplNumeratorAry[MAP_PIXEL+1] = +static int const s_ImplArySize = MAP_PIXEL+1; +static long aImplNumeratorAry[s_ImplArySize] = { 1, 1, 5, 50, 1, 1, 1, 1, 1, 1, 1 }; -static long aImplDenominatorAry[MAP_PIXEL+1] = +static long aImplDenominatorAry[s_ImplArySize] = { 2540, 254, 127, 127, 1000, 100, 10, 1, 72, 1440, 1 }; // ----------------------------------------------------------------------- @@ -1660,9 +1661,9 @@ basegfx::B2DPolyPolygon OutputDevice::PixelToLogic( const basegfx::B2DPolyPolygo #define ENTER3( eUnitSource, eUnitDest ) \ long nNumerator = 1; \ long nDenominator = 1; \ - DBG_ASSERT( eUnitSource <= MAP_PIXEL, "nonpermitted source map unit"); \ - DBG_ASSERT( eUnitDest <= MAP_PIXEL, "nonpermitted destination map unit"); \ - if( (eUnitSource <= MAP_PIXEL) && (eUnitDest <= MAP_PIXEL) ) \ + DBG_ASSERT( eUnitSource < s_ImplArySize, "Invalid source map unit"); \ + DBG_ASSERT( eUnitDest < s_ImplArySize, "Invalid destination map unit"); \ + if( (eUnitSource < s_ImplArySize) && (eUnitDest < s_ImplArySize) ) \ { \ nNumerator = aImplNumeratorAry[eUnitSource] * \ aImplDenominatorAry[eUnitDest]; \ |