From ac407ab285b69f67e0e82bc10ea4abdbe8f9c08f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 2 Dec 2020 13:04:27 +0000 Subject: cid#1470369 Uninitialized scalar variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara (cherry picked from commit 2a988b1ecddd17f9c851b625d33fbe0c4dfa2325) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118594 Tested-by: Jenkins Reviewed-by: Michael Stahl --- include/vcl/outdevmap.hxx | 10 ++++++++++ vcl/source/outdev/map.cxx | 18 +++--------------- 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 ) -- cgit