sw/source/filter/ww8/ww8atr.cxx |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 3ddd11d18a24ebd8cbc3e5ac8d460b4888cade07
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri May 17 14:15:23 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri May 17 17:43:03 2024 +0200

    WaE: C6011 Dereferencing NULL pointer warnings
    
    Change-Id: I18b18f5d430e626dea9163aec0bf99ab09c5c71b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167780
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 30fbebc4fbc3..e1787614f732 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -5521,17 +5521,21 @@ static void ParaTabStopDelAdd( WW8Export& rWrt,
             aTab.Add(*pTN, nLParaMgn);              // must be inserted
             nN++;
         }
-        else if (lcl_IsEqual(nOP, *pTO, nNP, *pTN)) // tabs are equal
-        {
-            nO++;                                   // nothing to do
-            nN++;
-        }
-        else                                        // tabs same position, 
different type
+        else
         {
-            aTab.Del(*pTO, nLStypeMgn);             // delete old one
-            aTab.Add(*pTN, nLParaMgn);              // insert new one
-            nO++;
-            nN++;
+            assert(pTO && pTN);
+            if (lcl_IsEqual(nOP, *pTO, nNP, *pTN)) // tabs are equal
+            {
+                nO++;                                   // nothing to do
+                nN++;
+            }
+            else                                        // tabs same position, 
different type
+            {
+                aTab.Del(*pTO, nLStypeMgn);             // delete old one
+                aTab.Add(*pTN, nLParaMgn);              // insert new one
+                nO++;
+                nN++;
+            }
         }
     } while( true );
 

Reply via email to