summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-27 09:24:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-27 09:25:14 +0000
commitdeaf847f5017bcf7bb345d691be9ae8fa0deff0e (patch)
tree992839e315558f7e0ecf557e1f92cf7973cbc893 /vcl
parent7d21ae342dc5c4d4c3a4f3f5c2603b7b6be84d00 (diff)
ofz#685 floating point exception
Change-Id: I22741241253a6e3dabd0afa331aef2343d5fac77
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/map.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index c89aeb600055..72d5f928d914 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -395,13 +395,15 @@ static long ImplPixelToLogic( long n, long nDPI, long nMapNum, long nMapDenom,
long nThres )
{
assert(nDPI > 0);
- if (nMapNum == 0)
+ long nDenom = nDPI * nMapNum;
+ if (nDenom == 0)
{
return 0;
}
+
#if (SAL_TYPES_SIZEOFLONG < 8)
if( (+n < nThres) && (-n < nThres) )
- n = (2 * n * nMapDenom) / (nDPI * nMapNum);
+ n = (2 * n * nMapDenom) / nDenom;
else
#else
(void) nThres;
@@ -409,7 +411,6 @@ static long ImplPixelToLogic( long n, long nDPI, long nMapNum, long nMapDenom,
{
sal_Int64 n64 = n;
n64 *= nMapDenom;
- long nDenom = nDPI * nMapNum;
n = (long)(2 * n64 / nDenom);
}
if( n < 0 ) --n; else ++n;