[Libreoffice-commits] core.git: editeng/source

Noel Grandin noel at peralex.com
Mon Oct 19 00:44:59 PDT 2015


 editeng/source/items/flditem.cxx  |    2 +-
 editeng/source/items/frmitems.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c260c34be04643a143573c6f76b03da06b58bb49
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Oct 19 09:43:25 2015 +0200

    fix cppcheck:nullPointerRedundantCheck commit
    
    fix my commit 2d64fcf4c8d3316ad9ae2232601678553dcad6a3
    "cppcheck:nullPointerRedundantCheck"
    
    Change-Id: I0875005d938b43a91e15c564a23d70cb097548a9

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index b308abe..73cb29c 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -360,7 +360,7 @@ bool SvxFieldItem::operator==( const SfxPoolItem& rItem ) const
     const SvxFieldData* pOtherFld = static_cast<const SvxFieldItem&>(rItem).GetField();
     if( pField == pOtherFld )
         return true;
-    if( pOtherFld == nullptr )
+    if( pField == nullptr || pOtherFld == nullptr )
         return false;
     return ( pField->Type() == pOtherFld->Type() )
             && ( *pField == *pOtherFld );
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 1b8912d..11cbfe2 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1666,7 +1666,7 @@ inline bool CmpBrdLn( const SvxBorderLine* pBrd1, const SvxBorderLine* pBrd2 )
 {
     if( pBrd1 == pBrd2 )
         return true;
-    if( pBrd1 == nullptr )
+    if( pBrd1 == nullptr || pBrd2 == nullptr)
         return false;
     return *pBrd1 == *pBrd2;
 }


More information about the Libreoffice-commits mailing list