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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 30 12:48:32 UTC 2019


 sw/source/core/undo/rolbck.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ec580f5ee7b40b9d778cce41fdff08276fecfe54
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Sep 30 11:57:40 2019 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Sep 30 14:47:41 2019 +0200

    pNew could be nullptr
    
    Both if branches dereference pNew, so just check for that instead of
    useless check for ( pOld || pNew ) which is granted if pOld != pNew
    
    Change-Id: I5654c0a4e12e614d4d2068ddae582c1b86f2d61f
    Reviewed-on: https://gerrit.libreoffice.org/79837
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 2fbc1356f4cf..a80d270cb81f 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1298,7 +1298,7 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst )
 
 void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
 {
-    if ( m_pHistory && ( pOld || pNew ) && pOld != pNew )
+    if ( m_pHistory && pNew && pOld != pNew )
     {
         if ( pNew->Which() < POOLATTR_END )
         {


More information about the Libreoffice-commits mailing list