summaryrefslogtreecommitdiff
path: root/vcl/source/outdev/map.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-04 10:01:57 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-04 10:01:57 +0100
commitd8e7bc042bd0912a66c231b101cecda0f838a80f (patch)
tree9027379f46796b18852a1ce3a7a7981dfe71bf82 /vcl/source/outdev/map.cxx
parenta47600e1f9f7969440a6fa1488892c2aa2de38a8 (diff)
Remove hack of replacing 0 with 1/LONG_MAX
...that hack was in there since the initial import, but it is unclear to me what it shall fix, and it rather leads to problems as reported by -fsanitize=signed-integer-overflow when OuptutDevice::PixelToLogic of a 1x1 Size calls ImplPixelToLogic with n=1, nMapDenom=LONG_MAX causing the computation of 2*n64 to overflow on 64-bit Linux. Change-Id: I2465da46175b8a1d4af1c23fb3df993230eec78d
Diffstat (limited to 'vcl/source/outdev/map.cxx')
-rw-r--r--vcl/source/outdev/map.cxx12
1 files changed, 0 insertions, 12 deletions
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 7a9cc0c2d063..5a43c07df54e 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -329,18 +329,6 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
rMapRes.mnMapScDenomX = aTempX.GetDenominator();
rMapRes.mnMapScNumY = aTempY.GetNumerator();
rMapRes.mnMapScDenomY = aTempY.GetDenominator();
-
- // hack: 0/n approximately 1/max
- if ( !rMapRes.mnMapScNumX )
- {
- rMapRes.mnMapScNumX = 1;
- rMapRes.mnMapScDenomX = LONG_MAX;
- }
- if ( !rMapRes.mnMapScNumY )
- {
- rMapRes.mnMapScNumY = 1;
- rMapRes.mnMapScDenomY = LONG_MAX;
- }
}
inline void ImplCalcMapResolution( const MapMode& rMapMode,