summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-02 13:04:27 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2021-07-08 10:44:29 +0200
commitac407ab285b69f67e0e82bc10ea4abdbe8f9c08f (patch)
tree23a3d0ebb936d07a62e95509867da32f39f5945d
parentofz#31370 Divide-by-zero (diff)
downloadcore-ac407ab285b69f67e0e82bc10ea4abdbe8f9c08f.tar.gz
core-ac407ab285b69f67e0e82bc10ea4abdbe8f9c08f.zip
cid#1470369 Uninitialized scalar variable
and cid#1470372 Uninitialized scalar variable cid#1470364 Uninitialized scalar variable cid#1470363 Uninitialized scalar variable cid#1470359 Uninitialized scalar variable cid#1470357 Uninitialized scalar variable cid#1470355 Uninitialized scalar variable cid#1470354 Uninitialized scalar variable cid#1470353 Uninitialized scalar variable Change-Id: I4a28f0f375f9108f4c43da7074f85d1fdbb3ebff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107070 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2a988b1ecddd17f9c851b625d33fbe0c4dfa2325) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118594 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--include/vcl/outdevmap.hxx10
-rw-r--r--vcl/source/outdev/map.cxx18
2 files changed, 13 insertions, 15 deletions
diff --git a/include/vcl/outdevmap.hxx b/include/vcl/outdevmap.hxx
index d4ef27e94e91..467dd688c612 100644
--- a/include/vcl/outdevmap.hxx
+++ b/include/vcl/outdevmap.hxx
@@ -28,6 +28,16 @@ struct ImplMapRes
tools::Long mnMapScNumY; // Scaling factor - numerator in Y direction
tools::Long mnMapScDenomX; // Scaling factor - denominator in X direction
tools::Long mnMapScDenomY; // Scaling factor - denominator in Y direction
+
+ ImplMapRes()
+ : mnMapOfsX(0)
+ , mnMapOfsY(0)
+ , mnMapScNumX(1)
+ , mnMapScNumY(1)
+ , mnMapScDenomX(1)
+ , mnMapScDenomY(1)
+ {
+ }
};
#endif // INCLUDED_VCL_OUTDEVMAP_HXX
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 3f478f2fdf88..dc7fca36fa3d 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -1344,17 +1344,11 @@ basegfx::B2DPolyPolygon OutputDevice::PixelToLogic( const basegfx::B2DPolyPolygo
return rSource; \
\
ImplMapRes aMapResSource; \
- aMapResSource.mnMapOfsX = 0; \
- aMapResSource.mnMapOfsY = 0; \
- aMapResSource.mnMapScNumX = 1; \
- aMapResSource.mnMapScNumY = 1; \
- aMapResSource.mnMapScDenomX = 1; \
- aMapResSource.mnMapScDenomY = 1; \
- ImplMapRes aMapResDest(aMapResSource); \
+ ImplMapRes aMapResDest; \
\
if ( !mbMap || pMapModeSource != &maMapMode ) \
{ \
- if ( pMapModeSource->GetMapUnit() == MapUnit::MapRelative ) \
+ if ( pMapModeSource->GetMapUnit() == MapUnit::MapRelative ) \
aMapResSource = maMapRes; \
ImplCalcMapResolution( *pMapModeSource, \
mnDPIX, mnDPIY, aMapResSource ); \
@@ -1402,13 +1396,7 @@ static void verifyUnitSourceDest( MapUnit eUnitSource, MapUnit eUnitDest )
#define ENTER4( rMapModeSource, rMapModeDest ) \
ImplMapRes aMapResSource; \
- aMapResSource.mnMapOfsX = 0; \
- aMapResSource.mnMapOfsY = 0; \
- aMapResSource.mnMapScNumX = 1; \
- aMapResSource.mnMapScNumY = 1; \
- aMapResSource.mnMapScDenomX = 1; \
- aMapResSource.mnMapScDenomY = 1; \
- ImplMapRes aMapResDest(aMapResSource); \
+ ImplMapRes aMapResDest; \
\
ImplCalcMapResolution( rMapModeSource, 72, 72, aMapResSource ); \
ImplCalcMapResolution( rMapModeDest, 72, 72, aMapResDest )