summaryrefslogtreecommitdiff
path: root/basebmp
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-18 09:43:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-18 09:44:57 +0100
commit37a3f9638315483114380a461f60abeab7809a3d (patch)
treecf26359b8b9b4ef2bd27b31a88e18055bb8c0bb0 /basebmp
parent32eaa77db33b3b1f5793e92167b9f8c2708ea543 (diff)
WaE: assuming signed overflow does not occur when assuming...
that (X + c) < X is always false [-Wstrict-overflow] Change-Id: I63880bf27ab7e34eb9e0be682b39b80b71d65103
Diffstat (limited to 'basebmp')
-rw-r--r--basebmp/source/bitmapdevice.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index fb08e322ea62..00fc1c21951c 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -339,8 +339,15 @@ namespace
{
if( !mpDamage )
return;
- basegfx::B2IPoint aEnd( rDamagePoint.getX() + 1,
- rDamagePoint.getY() + 1 );
+
+ sal_Int32 nX(rDamagePoint.getX());
+ sal_Int32 nY(rDamagePoint.getY());
+ if (nX < SAL_MAX_INT32)
+ ++nX;
+ if (nY < SAL_MAX_INT32)
+ ++nY;
+
+ basegfx::B2IPoint aEnd( nX, nY );
damaged( basegfx::B2IBox( rDamagePoint, aEnd ) );
}