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

Caolán McNamara caolanm at redhat.com
Fri Dec 2 08:59:36 UTC 2016


 sc/source/ui/unoobj/styleuno.cxx            |   11 ++++++-----
 vcl/unx/generic/fontmanager/fontmanager.cxx |    9 ++++++---
 vcl/unx/generic/print/genpspgraphics.cxx    |    9 ++-------
 3 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit 040407e267d2ae129e8527f74e3df51a2c7733fc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 2 08:57:50 2016 +0000

    coverity#1396675 Dereference null return value
    
    Change-Id: I5280ae6021b1a1d905c8e4af69b1342df4a69aa8

diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index cd414f7..612aa97 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -902,9 +902,12 @@ int PrintFontManager::getFontFaceNumber( fontID nFontID ) const
 {
     int nRet = 0;
     PrintFont* pFont = getFont( nFontID );
-    nRet = pFont->m_nCollectionEntry;
-    if (nRet < 0)
-        nRet = 0;
+    if (pFont)
+    {
+        nRet = pFont->m_nCollectionEntry;
+        if (nRet < 0)
+            nRet = 0;
+    }
     return nRet;
 }
 
commit 6a80d33bab27a14d35b72adc9d9869ba3f388dd9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 2 08:56:24 2016 +0000

    coverity#1396674 'Constant' variable guards dead code
    
    Change-Id: I9163b1663d2e2976fe6ca7983e94ed07af663f82

diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index f658435..dabd564 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -596,16 +596,14 @@ void GenPspGraphics::DrawTextLayout(const CommonSalLayout& rLayout)
     DeviceCoordinate aWidthAry[ nMaxGlyphs ];
     sal_Int32   aIdxAry  [ nMaxGlyphs ];
     sal_Unicode aUnicodes[ nMaxGlyphs ];
-    int         aCharPosAry [ nMaxGlyphs ];
 
     Point aPos;
     long nUnitsPerPixel = rLayout.GetUnitsPerPixel();
-    const sal_Unicode* pText = nullptr;
     int nMinCharPos = 0;
     int nMaxCharPos = 0;
     for( int nStart = 0;; )
     {
-        int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, pText ? aCharPosAry : nullptr );
+        int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, nullptr );
         if( !nGlyphCount )
             break;
 
@@ -615,10 +613,7 @@ void GenPspGraphics::DrawTextLayout(const CommonSalLayout& rLayout)
             nXOffset += aWidthAry[ i ];
             aIdxAry[ i ] = nXOffset / nUnitsPerPixel;
             sal_GlyphId aGlyphId = aGlyphAry[i] & (GF_IDXMASK | GF_ROTMASK);
-            if( pText )
-                aUnicodes[i] = (aCharPosAry[i] >= nMinCharPos && aCharPosAry[i] <= nMaxCharPos) ? pText[ aCharPosAry[i] ] : 0;
-            else
-                aUnicodes[i] = 0;
+            aUnicodes[i] = 0;
             aGlyphAry[i] = aGlyphId;
         }
 
commit 211925e144849ad14469a1a6c6451f61fcf369cf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 2 08:53:34 2016 +0000

    coverity#1396676 Uninitialized pointer field
    
    Change-Id: I7d7557485fe603f49ae176378ef41539ebe4970c

diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index d123734..1a6e8e9 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -943,11 +943,12 @@ void SAL_CALL ScStyleFamilyObj::removeVetoableChangeListener( const OUString&, c
 
 //  Default-ctor wird fuer die Reflection gebraucht
 
-ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName) :
-    pPropSet( (eFam == SfxStyleFamily::Para) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() ),
-    pDocShell( pDocSh ),
-    eFamily( eFam ),
-    aStyleName( rName )
+ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName)
+    : pPropSet( (eFam == SfxStyleFamily::Para) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() )
+    , pDocShell(pDocSh)
+    , eFamily(eFam)
+    , aStyleName(rName)
+    , pStyle_cached(nullptr)
 {
     //  pDocShell ist Null, wenn per ServiceProvider erzeugt
 


More information about the Libreoffice-commits mailing list