[Libreoffice-commits] core.git: 13 commits - dbaccess/source sc/source svx/source sw/source

Caolán McNamara caolanm at redhat.com
Thu Apr 10 13:08:27 PDT 2014


 dbaccess/source/ui/querydesign/QueryDesignView.cxx |    4 ++--
 sc/source/ui/view/olinewin.cxx                     |    5 +++--
 sc/source/ui/view/viewutil.cxx                     |    4 ++++
 svx/source/tbxctrls/layctrl.cxx                    |    5 +++--
 svx/source/xml/xmlgrhlp.cxx                        |    6 ++++--
 sw/source/core/draw/dcontact.cxx                   |   20 +++++++++++---------
 sw/source/core/edit/edlingu.cxx                    |    7 ++++++-
 sw/source/core/text/porlay.cxx                     |    7 +++++++
 sw/source/core/text/pormulti.cxx                   |    6 ++++--
 sw/source/core/text/txtdrop.cxx                    |    3 ++-
 sw/source/core/text/txtfrm.cxx                     |    2 +-
 sw/source/core/unocore/unostyle.cxx                |   10 +++++++---
 sw/source/filter/html/htmlform.cxx                 |   10 +++++-----
 13 files changed, 59 insertions(+), 30 deletions(-)

New commits:
commit 5e00a299b634220e24771428266b4a796f46e944
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 21:05:28 2014 +0100

    coverity#708390 Uninitialized scalar field
    
    Change-Id: I59d6f396c82ca8f43939256a04c56a79f0795a67

diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index fe928d6..e0fcd32 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -781,8 +781,9 @@ void SvxTableToolBoxControl::StateChanged( sal_uInt16, SfxItemState eState, cons
 
 // class SvxColumnsToolBoxControl ------------------------------------------
 
-SvxColumnsToolBoxControl::SvxColumnsToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
-    SfxToolBoxControl( nSlotId, nId, rTbx )
+SvxColumnsToolBoxControl::SvxColumnsToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
+    : SfxToolBoxControl(nSlotId, nId, rTbx)
+    , bEnabled(false)
 {
     rTbx.SetItemBits( nId, TIB_DROPDOWN | rTbx.GetItemBits( nId ) );
     rTbx.Invalidate();
commit 652c9faec724a554ef87761b39bf3525798fa2d1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 21:02:50 2014 +0100

    coverity#708393 Uninitialized scalar field
    
    Change-Id: Ief5553eb76c09fe2ed2a05ab2b2f67d03837517e

diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 3f4a051..7e00eb3 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -353,9 +353,11 @@ SvXMLGraphicHelper::SvXMLGraphicHelper( SvXMLGraphicHelperMode eCreateMode ) :
     Init( NULL, eCreateMode, false );
 }
 
-SvXMLGraphicHelper::SvXMLGraphicHelper() :
-    ::cppu::WeakComponentImplHelper2< ::com::sun::star::document::XGraphicObjectResolver,
+SvXMLGraphicHelper::SvXMLGraphicHelper()
+    : ::cppu::WeakComponentImplHelper2< ::com::sun::star::document::XGraphicObjectResolver,
                                       ::com::sun::star::document::XBinaryStreamResolver >( maMutex )
+    , meCreateMode(GRAPHICHELPER_MODE_READ)
+    , mbDirect(false)
 {
 }
 
commit 788c433a4a829f5054a0ee474de109317bdd6f3a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 21:00:29 2014 +0100

    coverity#708418 Uninitialized scalar field
    
    Change-Id: Id33b99cbad88eea79a7ac75d8d99ffcc71d4f7b4

diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index bc3a0fa..d0c84bd 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -181,7 +181,12 @@ const SwTxtNode *pLinguNode;
       SwTxtFrm  *pLinguFrm;
 
 SwLinguIter::SwLinguIter()
-    : pSh( 0 ), pStart( 0 ), pEnd( 0 ), pCurr( 0 ), pCurrX( 0 )
+    : pSh(0)
+    , pStart(0)
+    , pEnd(0)
+    , pCurr(0)
+    , pCurrX(0)
+    , nCrsrCnt(0)
 {
     // TODO missing: ensurance of re-entrance, OSL_ENSURE( etc.
 }
commit cdf8c72cedfee96f956e210dee37cbb501709300
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:58:48 2014 +0100

    coverity#708455 Uninitialized scalar field
    
    Change-Id: I266adca95feb9817226c02b183de8efbf83b04d6

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 3df2be0..a099b74 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -2058,6 +2058,13 @@ SwScriptInfo* SwScriptInfo::GetScriptInfo( const SwTxtNode& rTNd,
 }
 
 SwParaPortion::SwParaPortion()
+    : bFlag00(false)
+    , bFlag11(false)
+    , bFlag12(false)
+    , bFlag13(false)
+    , bFlag14(false)
+    , bFlag15(false)
+    , bFlag16(false)
 {
     FormatReset();
     bFlys = bFtnNum = bMargin = false;
commit 4ef6d67ddb80cddd94716484c282cb646230ff0f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:56:20 2014 +0100

    coverity#708457 Uninitialized scalar field
    
    Change-Id: I72a0a06bd341ce5527ff7ec88f8686a80e194117

diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index d215d19..9965493 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1269,8 +1269,10 @@ public:
 };
 
 SwSpaceManipulator::SwSpaceManipulator( SwTxtPaintInfo& rInf,
-                                        SwMultiPortion& rMult ) :
-         rInfo( rInf ), rMulti( rMult )
+                                        SwMultiPortion& rMult )
+    : rInfo(rInf)
+    , rMulti(rMult)
+    , nSpaceAdd(0)
 {
     pOldSpaceAdd = rInfo.GetpSpaceAdd();
     nOldSpIdx = rInfo.GetSpaceIdx();
commit 580bbbf85149e45e63e1d7a79bc86c13390b4967
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:55:16 2014 +0100

    coverity#708461 Uninitialized scalar field
    
    Change-Id: I93ffd3f440e41e5c0d4d0624d2092ea531e2f212

diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index bd39b62..a5f2a7f 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -111,7 +111,8 @@ SwDropPortion::SwDropPortion( const MSHORT nLineCnt,
     nDropDescent(nDrpDescent),
     nDistance(nDist),
     nFix(0),
-    nX(0)
+    nX(0),
+    nY(0)
 {
     SetWhichPor( POR_DROP );
 }
commit 93eb225988a21aefae2513f557bcb2168ae66774
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:41:31 2014 +0100

    coverity#735933 Explicit null dereferenced
    
    Change-Id: If1b1d5a5b701fe8b1faba97d52ff3bcd0da91747

diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 275fe35..ac1d2c7 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -717,19 +717,19 @@ void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rSha
     OSL_ENSURE( pSwShape, "Wo ist das SW-Shape?" );
 
     // es muss ein Draw-Format sein
-    SwFrmFmt *pFrmFmt = pSwShape->GetFrmFmt();
-    OSL_ENSURE( RES_DRAWFRMFMT == pFrmFmt->Which(), "Kein DrawFrmFmt" );
+    SwFrmFmt *pFrmFmt = pSwShape ? pSwShape->GetFrmFmt() : NULL ;
+    OSL_ENSURE( pFrmFmt && RES_DRAWFRMFMT == pFrmFmt->Which(), "Kein DrawFrmFmt" );
 
     // Schauen, ob es ein SdrObject dafuer gibt
-    const SdrObject *pObj = pFrmFmt->FindSdrObject();
+    const SdrObject *pObj = pFrmFmt ? pFrmFmt->FindSdrObject() : NULL;
     OSL_ENSURE( pObj, "SdrObject nicht gefunden" );
-    OSL_ENSURE( FmFormInventor == pObj->GetObjInventor(), "falscher Inventor" );
+    OSL_ENSURE( pObj && FmFormInventor == pObj->GetObjInventor(), "falscher Inventor" );
 
     const SdrView* pDrawView = pVSh ? pVSh->GetDrawView() : 0;
 
     SdrUnoObj *pFormObj = PTR_CAST( SdrUnoObj, pObj );
     uno::Reference< awt::XControl > xControl;
-    if ( pDrawView && pVSh->GetWin() )
+    if ( pDrawView && pVSh->GetWin() && pFormObj )
         xControl = pFormObj->GetUnoControl( *pDrawView, *pVSh->GetWin() );
 
     awt::Size aSz( rShape->getSize() );
commit fd014b7cf8b659c5db01acff8cb2bb2172e78313
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:39:17 2014 +0100

    coverity#735925 Explicit null dereferenced
    
    Change-Id: I1075679d34153a1a732e7f3559f92ddd8b81599e

diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index f8247ed..57ec2ba 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -3230,10 +3230,14 @@ static void lcl_putItemToSet(const SvxSetItem* pSetItem, sal_uInt16 nRes, sal_uI
             case TYPE_BOX: pNewItem = new SvxBoxItem(nRes);         break;
         }
     }
-    pNewItem->PutValue(rVal, nMemberId);
-    rSetSet.Put(*pNewItem);
+    assert(pNewItem);
+    if (pNewItem)
+    {
+        pNewItem->PutValue(rVal, nMemberId);
+        rSetSet.Put(*pNewItem);
+        delete pNewItem;
+    }
     rBaseImpl.GetItemSet().Put(*pNewSetItem);
-    delete pNewItem;
     delete pNewSetItem;
 }
 
commit 6af30ecb9ade40a1d6d7eedc01ed4b8adca1938d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:36:07 2014 +0100

    coverity#735902 Explicit null dereferenced
    
    Change-Id: Id32182b59a104c0de1fa61e91cdf9c25b29b243d

diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index a696fb4..e5961d5 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1792,21 +1792,23 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
                                 }
                             }
                         }
-                        // #i29199# - It is possible, that
-                        // the anchor doesn't exist - E.g., reordering the
-                        // sub-documents in a master document.
-                        // Note: The anchor will be inserted later.
-                        if ( !pModify )
-                        {
-                            // break to end of the current switch case.
-                            break;
-                        }
                     }
                     else
                     {
                         pModify = pAnch->GetCntntAnchor()->nNode.GetNode().GetCntntNode();
                     }
                 }
+
+                // #i29199# - It is possible, that
+                // the anchor doesn't exist - E.g., reordering the
+                // sub-documents in a master document.
+                // Note: The anchor will be inserted later.
+                if ( !pModify )
+                {
+                    // break to end of the current switch case.
+                    break;
+                }
+
                 SwIterator<SwFrm,SwModify> aIter( *pModify );
                 SwFrm* pAnchorFrmOfMaster = 0;
                 for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
commit 5cfe8815358956795501cb2d471ff5389e219fb6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:27:18 2014 +0100

    coverity#705931 Dereference before null check
    
    Change-Id: I7b245202daf5084a9cd73d0fb2df88abb2db4e78

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 91a21d2..1736839 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1977,7 +1977,7 @@ KSHORT SwTxtFrm::GetParHeight() const
 
     // FME, OD 08.01.2004 #i11859# - refactoring and improve code
     const SwLineLayout* pLineLayout = GetPara();
-    KSHORT nHeight = pLineLayout->GetRealHeight();
+    KSHORT nHeight = pLineLayout ? pLineLayout->GetRealHeight() : 0;
     if( GetOfst() && !IsFollow() )  // Ist dieser Absatz gescrollt? Dann ist unsere
         nHeight *= 2;               // bisherige Hoehe mind. eine Zeilenhoehe zu gering
     // OD 2004-03-04 #115793#
commit 97865e0a72272d5be8c65d636eafdba04736a58d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:21:48 2014 +0100

    coverity#983369 Dereference before null check
    
    Change-Id: Ifadcbe32aa64a9653f4e8dd8742dd3c5da22facd

diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 2f105d7..c312399 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -1212,11 +1212,11 @@ namespace
                                         const ::connectivity::OSQLParseNode* pNode,
                                         sal_uInt16& rLevel )
     {
-        if (!SQL_ISRULE(pNode, select_statement))
+        if (!pNode || !SQL_ISRULE(pNode, select_statement))
             return eNoSelectStatement;
 
         // nyi: more checking for the correct structure!
-        pNode = pNode ? pNode->getChild(3)->getChild(1) : NULL;
+        pNode = pNode->getChild(3)->getChild(1);
         // no where clause found
         if (!pNode || pNode->isLeaf())
             return eOk;
commit af110680a5dafffbb4ab13c23cb4c977afad16ca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 10 20:19:49 2014 +0100

    coverity#705472 Dereference null return value
    
    Change-Id: I1786b212207d1993246f24ad5f5237453554984a

diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index 525df55..d65234b 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -297,9 +297,10 @@ bool ScOutlineWindow::GetEntryPos(
         rnImagePos = rnStartPos;
 
     // do not cover previous collapsed image
-    if ( !bHidden && nEntry )
+    bool bDoNoCover = !bHidden && nEntry;
+    const ScOutlineEntry* pPrevEntry = bDoNoCover ? GetOutlineEntry(nLevel, nEntry - 1) : NULL;
+    if (pPrevEntry)
     {
-        const ScOutlineEntry* pPrevEntry = GetOutlineEntry( nLevel, nEntry - 1 );
         SCCOLROW nPrevEnd = pPrevEntry->GetEnd();
         if ( (nPrevEnd + 1 == nStart) && IsHidden( nPrevEnd ) )
         {
commit c27fc13c9947170480b62058849f72ea779bc5b0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 9 16:25:59 2014 +0100

    coverity#708112 Uninitialized scalar field
    
    Change-Id: I488f784430a252326466954bf4a29f4ddd72bd83

diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 5e27bbf..342c6e5 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -391,6 +391,10 @@ void ScViewUtil::SetFullScreen( SfxViewShell& rViewShell, bool bSet )
 
 
 ScUpdateRect::ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 )
+    : nNewStartX(0)
+    , nNewStartY(0)
+    , nNewEndX(0)
+    , nNewEndY(0)
 {
     PutInOrder( nX1, nX2 );
     PutInOrder( nY1, nY2 );


More information about the Libreoffice-commits mailing list