[Libreoffice-commits] core.git: 8 commits - sfx2/source svx/source sw/source

Caolán McNamara caolanm at redhat.com
Mon Mar 31 02:04:06 PDT 2014


 sfx2/source/control/bindings.cxx        |    4 +---
 sfx2/source/dialog/tabdlg.cxx           |    4 +++-
 sfx2/source/doc/sfxbasemodel.cxx        |    2 +-
 svx/source/svdraw/svdedtv2.cxx          |    2 +-
 sw/source/core/docnode/swbaslnk.cxx     |    2 +-
 sw/source/core/frmedt/fecopy.cxx        |    4 ++--
 sw/source/core/layout/pagechg.cxx       |    2 +-
 sw/source/core/uibase/utlui/content.cxx |   21 +++++++++++++++------
 8 files changed, 25 insertions(+), 16 deletions(-)

New commits:
commit 6bc678d61478ce0f54e14ad2ef0d4897e7bf5763
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:53:53 2014 +0100

    coverity#1194890 Unchecked return value
    
    Change-Id: I7c1e74f5c685f10d7eba8afb7acb60d2c2e9906b

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 94e3424..9eece34 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2983,7 +2983,7 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL
                                 }
 
                                 uno::Sequence< beans::NamedValue > aOldEncryptionData;
-                                GetEncryptionData_Impl( pMedium->GetItemSet(), aOldEncryptionData );
+                                (void)GetEncryptionData_Impl( pMedium->GetItemSet(), aOldEncryptionData );
 
                                 if ( !aOldEncryptionData.getLength() && !aNewEncryptionData.getLength() )
                                     throw;
commit b3b8c56de80d5dc82e0138c28e8dadaeefb8daf7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:51:30 2014 +0100

    coverity#1194888 Unchecked return value
    
    Change-Id: Id9478984bdfd11a3cb656e5c8441e1b205282c2b

diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 2ccf290..633ef61 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -396,7 +396,7 @@ bool SwBaseLink::SwapIn( bool bWaitForData, bool bNativFormat )
     {
         OUString aMimeType( SotExchange::GetFormatMimeType( GetContentType() ));
         uno::Any aValue;
-        GetObj()->GetData( aValue, aMimeType, !IsSynchron() && bWaitForData );
+        (void)GetObj()->GetData( aValue, aMimeType, !IsSynchron() && bWaitForData );
 
         if( bWaitForData && !GetObj() )
         {
commit 14dd082b247ec1eecb4c26bcde06f370201e9f30
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:47:30 2014 +0100

    coverity#1194907 Explicit null dereferenced
    
    Change-Id: I985c91f5b29d3642ca03355c9c6218ae94735549

diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index c82e4e6..29bc434 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1266,7 +1266,7 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly)
 
     const sal_uInt32 nPolyCount(aPolyPolygon.count());
 
-    if(nPolyCount)
+    if (nPolyCount && pAttrObj)
     {
         SdrObjKind eKind = OBJ_PATHFILL;
 
commit e8506c99ca303774c677e2978357839e1aeb11eb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:44:46 2014 +0100

    coverity#705489 Dereference null return value
    
    Change-Id: I5366c5d653d553494a33b6ea3f511e7d0a56a86d

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 6e64d99..57385e5 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1376,9 +1376,9 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
 
                     Point aNullPt;
                     SwFlyFrm* pFlyFrm = ((SwFlyFrmFmt*)pFmt)->GetFrm( &aNullPt );
-                    pAnchor = pFlyFrm->GetAnchorFrm();
+                    pAnchor = pFlyFrm ? pFlyFrm->GetAnchorFrm() : NULL;
 
-                    if( pAnchor->FindFooterOrHeader() )
+                    if (!pAnchor || pAnchor->FindFooterOrHeader())
                     {
                         // if there is a textframe in the header/footer:
                         // do not replace but insert
commit c1a1ec5391cfbb814f67ec903bf6a25ae38597f9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:41:46 2014 +0100

    coverity#1194926 Dereference before null check
    
    Change-Id: I1825de227b760624faaa68a1de2d3ecd5b7657a5

diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 037e06c..ff309bc 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1118,9 +1118,7 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem*
     SfxShell *pShell=0;
     const SfxSlot *pSlot=0;
 
-    // if slot was uncached, we should have created a cache in this method!
-    DBG_ASSERT( pCache, "This code needs a cache!");
-    const SfxSlotServer* pServer = pCache ? pCache->GetSlotServer( rDispatcher, pImp->xProv ) : 0;
+    const SfxSlotServer* pServer = pCache->GetSlotServer( rDispatcher, pImp->xProv );
     if ( !pServer )
     {
         return NULL;
commit a83ad7c119c111831a3a0283b3339636d4bca703
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:38:56 2014 +0100

    coverity#1194910 Dereference after null check
    
    Change-Id: Ic6e06b78e9dee50fd3a68c79fc5689ac835ea023

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 1a976615..4b66fbf 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -597,7 +597,7 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
                 // online layout.
                 //MakeAll();
             }
-            else
+            else if (pNew)
             {
                 const SwFmtFrmSize &rSz = nWhich == RES_FMT_CHG ?
                         ((SwFmtChg*)pNew)->pChangedFmt->GetFrmSize() :
commit 835b983d663bcf74f04f9ff6fb7f573779d581e0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:37:22 2014 +0100

    coverity#1194909 Dereference after null check
    
    Change-Id: Iaa7cb625e4ce49b51a1585497befb67fda0a2d85

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9952c62..7510125 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1227,7 +1227,9 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
         pDataObject = Find(pImpl->aData, nId);
     }
 
-    DBG_ASSERT( pDataObject, "Id not known" );
+    assert(pDataObject); //Id not known
+    if (!pDataObject)
+        return 0;
 
     // Create TabPage if possible:
     if ( !pTabPage )
commit 487943fcc33db87aa7bc7bfd45e4eb08dd62895b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 31 09:35:15 2014 +0100

    coverity#1194903 Dereference after null check
    
    Change-Id: I2eac830268ee43f19c0c5b5bda49a966282d6fc5

diff --git a/sw/source/core/uibase/utlui/content.cxx b/sw/source/core/uibase/utlui/content.cxx
index 969cf14..c30f987 100644
--- a/sw/source/core/uibase/utlui/content.cxx
+++ b/sw/source/core/uibase/utlui/content.cxx
@@ -3006,8 +3006,7 @@ void SwContentTree::ShowActualView()
     GetParentWindow()->UpdateListBox();
 }
 
-// Here are the buttons for moving outlines are en-/disabled.
-
+// Here the buttons for moving outlines are en-/disabled.
 bool SwContentTree::Select( SvTreeListEntry* pEntry, bool bSelect )
 {
     if(!pEntry)
@@ -3018,10 +3017,20 @@ bool SwContentTree::Select( SvTreeListEntry* pEntry, bool bSelect )
     {
         pParentEntry = GetParent(pParentEntry);
     }
-    if(!bIsLastReadOnly && (!IsVisible() ||
-        ( (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE && pParentEntry) ||
-            (lcl_IsContent(pEntry) && ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE)) ))
-        bEnable = sal_True;
+    if (!bIsLastReadOnly)
+    {
+        if (!IsVisible())
+            bEnable = sal_True;
+        else if (pParentEntry)
+        {
+            if ((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) ||
+                (lcl_IsContent(pEntry) &&
+                    ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE))
+            {
+                bEnable = sal_True;
+            }
+        }
+    }
     SwNavigationPI* pNavi = GetParentWindow();
     pNavi->aContentToolBox.EnableItem(FN_ITEM_UP ,  bEnable);
     pNavi->aContentToolBox.EnableItem(FN_ITEM_DOWN, bEnable);


More information about the Libreoffice-commits mailing list