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

Norbert Thiebaud nthiebaud at gmail.com
Sat Feb 15 05:30:38 CET 2014


 filter/source/graphicfilter/eos2met/eos2met.cxx |   23 +++++
 filter/source/graphicfilter/icgm/bundles.hxx    |   26 +++++-
 vcl/source/gdi/outdev3.cxx                      |   93 +++++++++++-------------
 3 files changed, 85 insertions(+), 57 deletions(-)

New commits:
commit fe671289c1f3f4532ebea3cd3b11b73dfd631bf9
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Feb 8 15:56:04 2014 -0600

    coverity#738935 Unitialized scalar field
    
    Change-Id: I88d921cc3a670a6cfd2f8a10e5c866a4874eb484

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 5e66e31e..3a42baf 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -910,15 +910,16 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
 }
 
 ImplFontEntry::ImplFontEntry( const FontSelectPattern& rFontSelData )
-:   maFontSelData( rFontSelData ),
-    maMetric( rFontSelData ),
-    mpConversion( NULL ),
-    mnRefCount( 1 ),
-    mnSetFontFlags( 0 ),
-    mnOwnOrientation( 0 ),
-    mnOrientation( 0 ),
-    mbInit( false ),
-    mpUnicodeFallbackList( NULL )
+    : maFontSelData( rFontSelData )
+    , maMetric( rFontSelData )
+    , mpConversion( NULL )
+    , mnLineHeight( 0 )
+    , mnRefCount( 1 )
+    , mnSetFontFlags( 0 )
+    , mnOwnOrientation( 0 )
+    , mnOrientation( 0 )
+    , mbInit( false )
+    , mpUnicodeFallbackList( NULL )
 {
     maFontSelData.mpFontEntry = this;
 }
commit 22f403de376382f16607c4f0a8500aa60a356004
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Feb 8 15:50:16 2014 -0600

    coverity#738936 Unitialized scalar field
    
    Change-Id: Ic35d33e99db9b8449f18fb0a1a8cb6c1003c5931

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 810241c..5e66e31e 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -3225,13 +3225,41 @@ bool ImplFontAttributes::operator==(const ImplFontAttributes& rOther) const
 }
 
 ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
-:   ImplFontAttributes( rFontSelData )
+    : ImplFontAttributes( rFontSelData )
+    , mnWidth ( rFontSelData.mnWidth)
+    , mnOrientation( (short)(rFontSelData.mnOrientation))
+    , mnAscent( 0 )
+    , mnDescent( 0 )
+    , mnIntLeading( 0 )
+    , mnExtLeading( 0 )
+    , mnSlant( 0 )
+    , mnMinKashida( 0 )
+    , mnUnderlineSize( 0 )
+    , mnUnderlineOffset( 0 )
+    , mnBUnderlineSize( 0 )
+    , mnBUnderlineOffset( 0 )
+    , mnDUnderlineSize( 0 )
+    , mnDUnderlineOffset1( 0 )
+    , mnDUnderlineOffset2( 0 )
+    , mnWUnderlineSize( 0 )
+    , mnWUnderlineOffset( 0 )
+    , mnAboveUnderlineSize( 0 )
+    , mnAboveUnderlineOffset( 0 )
+    , mnAboveBUnderlineSize( 0 )
+    , mnAboveBUnderlineOffset( 0 )
+    , mnAboveDUnderlineSize( 0 )
+    , mnAboveDUnderlineOffset1( 0 )
+    , mnAboveDUnderlineOffset2( 0 )
+    , mnAboveWUnderlineSize( 0 )
+    , mnAboveWUnderlineOffset( 0 )
+    , mnStrikeoutSize( 0 )
+    , mnStrikeoutOffset( 0 )
+    , mnBStrikeoutSize( 0 )
+    , mnBStrikeoutOffset( 0 )
+    , mnDStrikeoutSize( 0 )
+    , mnDStrikeoutOffset1( 0 )
+    , mnDStrikeoutOffset2( 0 )
 {
-    // initialize the members provided by the font request
-    mnWidth        = rFontSelData.mnWidth;
-    mnSlant        = rFontSelData.GetSlant();
-    mnOrientation  = sal::static_int_cast<short>(rFontSelData.mnOrientation);
-
     // intialize the used font name
     if( rFontSelData.mpFontData )
     {
@@ -3248,40 +3276,6 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
         mbDevice   = false;
         mbKernableFont = false;
     }
-
-    // reset metrics that are usually measured for the font instance
-    mnAscent       = 0;
-    mnDescent      = 0;
-    mnIntLeading   = 0;
-    mnExtLeading   = 0;
-    mnMinKashida   = 0;
-
-    // reset metrics that are usually derived from the measurements
-    mnUnderlineSize            = 0;
-    mnUnderlineOffset          = 0;
-    mnBUnderlineSize           = 0;
-    mnBUnderlineOffset         = 0;
-    mnDUnderlineSize           = 0;
-    mnDUnderlineOffset1        = 0;
-    mnDUnderlineOffset2        = 0;
-    mnWUnderlineSize           = 0;
-    mnWUnderlineOffset         = 0;
-    mnAboveUnderlineSize       = 0;
-    mnAboveUnderlineOffset     = 0;
-    mnAboveBUnderlineSize      = 0;
-    mnAboveBUnderlineOffset    = 0;
-    mnAboveDUnderlineSize      = 0;
-    mnAboveDUnderlineOffset1   = 0;
-    mnAboveDUnderlineOffset2   = 0;
-    mnAboveWUnderlineSize      = 0;
-    mnAboveWUnderlineOffset    = 0;
-    mnStrikeoutSize            = 0;
-    mnStrikeoutOffset          = 0;
-    mnBStrikeoutSize           = 0;
-    mnBStrikeoutOffset         = 0;
-    mnDStrikeoutSize           = 0;
-    mnDStrikeoutOffset1        = 0;
-    mnDStrikeoutOffset2        = 0;
 }
 
 void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev )
commit f2cdfce269117e2c4be4eb34d27d9b517bc81760
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Feb 8 13:10:13 2014 -0600

    coverity#707807-08-09 Unitialized scalar field
    
    Change-Id: I0a4eea4f7e6fda224f081f69a88a87492032569d

diff --git a/filter/source/graphicfilter/icgm/bundles.hxx b/filter/source/graphicfilter/icgm/bundles.hxx
index 250c6be..08f17f2 100644
--- a/filter/source/graphicfilter/icgm/bundles.hxx
+++ b/filter/source/graphicfilter/icgm/bundles.hxx
@@ -35,15 +35,19 @@ class Bundle
 
 public:
     void                SetColor( sal_uInt32 nColor ) ;
-    sal_uInt32              GetColor() const;
+    sal_uInt32          GetColor() const;
     long                GetIndex() const { return mnBundleIndex; } ;
     void                SetIndex( long nBundleIndex ) { mnBundleIndex = nBundleIndex; } ;
 
-                        Bundle() {};
+    Bundle()
+        : mnBundleIndex( 0 )
+        , mnColor( 0 )
+        {};
+
     virtual Bundle*     Clone() { return new Bundle( *this ); };
             Bundle&     operator=( Bundle& rBundle );
 
-    virtual             ~Bundle() {} ;
+    virtual            ~Bundle() {} ;
 };
 
 // ---------------------------------------------------------------
@@ -73,7 +77,11 @@ public:
     MarkerType          eMarkerType;
     double              nMarkerSize;
 
-                        MarkerBundle() {};
+    MarkerBundle()
+        : eMarkerType( MT_POINT )
+        , nMarkerSize( 0.0 )
+        {};
+
     virtual Bundle*     Clone() { return new MarkerBundle( *this ); } ;
             MarkerBundle&   operator=( MarkerBundle& rMarkerBundle );
     virtual             ~MarkerBundle() {};
@@ -102,12 +110,18 @@ class TextBundle : public Bundle
 {
 public:
 
-    sal_uInt32              nTextFontIndex;
+    sal_uInt32          nTextFontIndex;
     TextPrecision       eTextPrecision;
     double              nCharacterExpansion;
     double              nCharacterSpacing;
 
-                        TextBundle() {};
+    TextBundle()
+        : nTextFontIndex( 0 )
+        , eTextPrecision( TPR_UNDEFINED )
+        , nCharacterExpansion( 0.0 )
+        , nCharacterSpacing( 0.0 )
+        {};
+
     virtual Bundle*     Clone() { return new TextBundle( *this ); } ;
             TextBundle& operator=( TextBundle& rTextBundle );
     virtual             ~TextBundle() {};
commit 1c20c67b5eae1ccc7a79e4b8a42b929dcd0e4859
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Feb 8 13:03:00 2014 -0600

    coverity#707795 Unitialized scalar field
    
    Change-Id: Ib3f1bc5c49954e444f2db21372ee2214ee0bbb35

diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index 5f3b43d..a7c9ef8 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -235,8 +235,27 @@ private:
 
 public:
 
-    METWriter() :
-        pMET(NULL), pGDIStack(NULL), nMETStrokeLineWidth(0), nMETChrAngle(0), pChrSetList(NULL), pCompDev(NULL)
+    METWriter()
+        : bStatus(sal_False)
+        , nLastPercent( 0 )
+        , pMET(NULL)
+        , nActualFieldStartPos( 0 )
+        , nNumberOfDataFields( 0 )
+        , eGDIRasterOp( ROP_OVERPAINT )
+        , pGDIStack(NULL)
+        , eMETMix( ROP_OVERPAINT )
+        , nMETStrokeLineWidth(0)
+        , nMETChrAngle(0)
+        , nMETChrSet( 0 )
+        , pChrSetList(NULL)
+        , nNextChrSetId( 0 )
+        , nActBitmapId( 0 )
+        , nNumberOfActions( 0 )
+        , nNumberOfBitmaps( 0 )
+        , nWrittenActions( 0 )
+        , nWrittenBitmaps( 0 )
+        , nActBitmapPercent( 0 )
+        , pCompDev(NULL)
     {
         pCompDev = reinterpret_cast< OutputDevice* >( Application::GetAppWindow() );
         if( !pCompDev )


More information about the Libreoffice-commits mailing list