[Libreoffice-commits] core.git: 3 commits - vcl/generic vcl/unx

Caolán McNamara caolanm at redhat.com
Sat Apr 26 07:33:44 PDT 2014


 vcl/generic/glyphs/gcach_ftyp.cxx        |   14 ++++++-----
 vcl/unx/generic/dtrans/X11_selection.cxx |    3 +-
 vcl/unx/generic/gdi/salgdi.cxx           |   37 ++++++++++++++++---------------
 3 files changed, 30 insertions(+), 24 deletions(-)

New commits:
commit 0dd194fb1e77161b5dbca5484fd503a0375010f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Apr 26 14:41:52 2014 +0100

    coverity#708654 Uninitialized pointer field
    
    Change-Id: Ic342d785746280b6c75d237cfafc83a42786ec7f

diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 24836bb..c949e50 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -238,6 +238,7 @@ SelectionManager::SelectionManager() :
         m_bLastDropAccepted( false ),
         m_bDropSuccess( false ),
         m_bDropSent( false ),
+        m_nDropTimeout( 0 ),
         m_bWaitingForPrimaryConversion( false ),
         m_nDragTimestamp( None ),
         m_aMoveCursor( None ),
@@ -272,7 +273,7 @@ SelectionManager::SelectionManager() :
         m_nXdndActionPrivate( None ),
         m_bShutDown( false )
 {
-    m_aDropEnterEvent.data.l[0] = None;
+    memset(&m_aDropEnterEvent, 0, sizeof(m_aDropEnterEvent));
     m_aDragRunning.reset();
 }
 
commit 8995371b01560fa7358ef1ef21a31d614e6fe7f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Apr 26 14:37:16 2014 +0100

    annoying inlines and formatting
    
    Change-Id: I4a664c1c71a5aab183e7441dcdbcdb8b769fb996

diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index c838d56..bbc2b36 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -57,28 +57,31 @@
 
 class SalPolyLine
 {
-            XPoint              Points_[STATIC_POINTS];
-            XPoint             *pFirst_;
+    XPoint Points_[STATIC_POINTS];
+    XPoint *pFirst_;
 public:
-    inline                      SalPolyLine( sal_uLong nPoints, const SalPoint *p );
-    inline                      ~SalPolyLine();
-    inline  XPoint             &operator [] ( sal_uLong n ) const
-                                { return pFirst_[n]; }
-};
+    SalPolyLine(sal_uLong nPoints, const SalPoint *p)
+        : pFirst_(nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_)
+    {
+        for( sal_uLong i = 0; i < nPoints; i++ )
+        {
+            pFirst_[i].x = (short)p[i].mnX;
+            pFirst_[i].y = (short)p[i].mnY;
+        }
+        pFirst_[nPoints] = pFirst_[0]; // close polyline
+    }
 
-inline SalPolyLine::SalPolyLine( sal_uLong nPoints, const SalPoint *p )
-    : pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
-{
-    for( sal_uLong i = 0; i < nPoints; i++ )
+    ~SalPolyLine()
     {
-        pFirst_[i].x = (short)p[i].mnX;
-        pFirst_[i].y = (short)p[i].mnY;
+        if( pFirst_ != Points_ )
+            delete [] pFirst_;
     }
-    pFirst_[nPoints] = pFirst_[0]; // close polyline
-}
 
-inline SalPolyLine::~SalPolyLine()
-{ if( pFirst_ != Points_ ) delete [] pFirst_; }
+    XPoint &operator [] ( sal_uLong n ) const
+    {
+        return pFirst_[n];
+    }
+};
 
 #undef STATIC_POINTS
 
commit 5da0eb4d45c6ffa9b8b290812edf277736f93f52
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Apr 26 13:33:02 2014 +0100

    coverity#738920 Uninitialized scalar field
    
    Change-Id: I4796075c4727d30178bb6c7d0752e87ab22c36cf

diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index ab5ddd8..7a05833 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -475,9 +475,13 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
     mnPrioAntiAlias(nDefaultPrioAntiAlias),
     mnPrioAutoHint(nDefaultPrioAutoHint),
     mpFontInfo( pFI ),
+    mnLoadFlags( 0 ),
     maFaceFT( NULL ),
     maSizeFT( NULL ),
     mbFaceOk( false ),
+    mbArtItalic( false ),
+    mbArtBold( false ),
+    mbUseGamma( false ),
     mpLayoutEngine( NULL )
 {
     // TODO: move update of mpFontEntry into FontEntry class when
@@ -491,11 +495,6 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
         mnSin = static_cast<long>( 0x10000 * sin( dRad ) + 0.5 );
     }
 
-    maFaceFT = pFI->GetFaceFT();
-
-    if( !maFaceFT )
-        return;
-
     // set the pixel size of the font instance
     mnWidth = rFSD.mnWidth;
     if( !mnWidth )
@@ -505,6 +504,10 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
     if( (mnWidth < 0) || (mfStretch > +64.0) || (mfStretch < -64.0) )
         return;
 
+    maFaceFT = pFI->GetFaceFT();
+    if( !maFaceFT )
+        return;
+
     FT_New_Size( maFaceFT, &maSizeFT );
     FT_Activate_Size( maSizeFT );
     FT_Error rc = FT_Set_Pixel_Sizes( maFaceFT, mnWidth, rFSD.mnHeight );
@@ -535,7 +538,6 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
 
     mbArtItalic = (rFSD.GetSlant() != ITALIC_NONE && pFI->GetFontAttributes().GetSlant() == ITALIC_NONE);
     mbArtBold = (rFSD.GetWeight() > WEIGHT_MEDIUM && pFI->GetFontAttributes().GetWeight() <= WEIGHT_MEDIUM);
-    mbUseGamma = false;
     if( mbArtBold )
     {
         //static const int TT_CODEPAGE_RANGE_874  = (1L << 16); // Thai


More information about the Libreoffice-commits mailing list