[Libreoffice-commits] core.git: include/vcl vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 2 17:18:24 UTC 2020


 include/vcl/outdevmap.hxx |   10 ++++++++++
 vcl/source/outdev/map.cxx |   18 +++---------------
 2 files changed, 13 insertions(+), 15 deletions(-)

New commits:
commit 2a988b1ecddd17f9c851b625d33fbe0c4dfa2325
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 2 13:04:27 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 2 18:17:36 2020 +0100

    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 at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

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 efd8e587ce0e..09ae63b0174d 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -1289,17 +1289,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 );         \
@@ -1347,13 +1341,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 )


More information about the Libreoffice-commits mailing list