summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/metric.cxx2
-rw-r--r--vcl/source/gdi/outmap.cxx11
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx2
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx2
4 files changed, 9 insertions, 8 deletions
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 39b08f6ff460..c2df97cf8b05 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -748,7 +748,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 e702a0f6d6ce..f42f791d5a69 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -60,9 +60,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 };
// -----------------------------------------------------------------------
@@ -1952,9 +1953,9 @@ Region OutputDevice::PixelToLogic( const Region& rDeviceRegion,
#define ENTER3( eUnitSource, eUnitDest ) \
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) ) \
+ 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]; \
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index 03e9f2a5e379..e44193c2bdbc 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -313,7 +313,7 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
initialized = true;
}
- static const sal_Int32 nMapSize = sizeof(roleMap)/sizeof(sal_Int16);
+ static const sal_Int32 nMapSize = sizeof(roleMap)/sizeof(roleMap[0]);
if( 0 <= nRole && nMapSize > nRole )
role = roleMap[nRole];
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index abbfc996bc76..8f17f1f8d10e 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -364,7 +364,7 @@ GdkCursor* GtkSalDisplay::getFromXPM( const char *pBitmap,
GdkCursor *GtkSalDisplay::getCursor( PointerStyle ePointerStyle )
{
- if( ePointerStyle > POINTER_COUNT )
+ if (ePointerStyle >= POINTER_COUNT)
return NULL;
if ( !m_aCursors[ ePointerStyle ] )