sw/inc/ndindex.hxx              |    2 +-
 sw/source/core/doc/docredln.cxx |    1 -
 sw/source/core/undo/unsect.cxx  |    2 ++
 sw/source/filter/ww8/ww8par.cxx |    5 -----
 4 files changed, 3 insertions(+), 7 deletions(-)

New commits:
commit b13631c562e85a6567a600edc5bb1d93418e4f53
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Jul 26 11:09:10 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Jul 26 22:41:42 2022 +0200

    make SwNodeIndex as SAL_WARN_UNUSED
    
    Change-Id: I26878594ea5629d8827bb2465050e5e5acc600e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137458
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx
index d97c58947d0c..c25d5530d02f 100644
--- a/sw/inc/ndindex.hxx
+++ b/sw/inc/ndindex.hxx
@@ -27,7 +27,7 @@
 #include "nodeoffset.hxx"
 
 /// Marks a node in the document model.
-class SW_DLLPUBLIC SwNodeIndex final : public sw::Ring<SwNodeIndex>
+class SAL_WARN_UNUSED SW_DLLPUBLIC SwNodeIndex final : public 
sw::Ring<SwNodeIndex>
 {
     SwNode * m_pNode;
 
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index acf28394c840..4a1134f0d78e 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -1531,7 +1531,6 @@ void SwRangeRedline::MoveToSection()
                                             SwNormalStartNode, pColl );
             SwTextNode* pTextNd = rNds[ pSttNd->GetIndex() + 1 
]->GetTextNode();
 
-            SwNodeIndex aNdIdx( *pTextNd );
             SwPosition aPos( *pTextNd );
             if( pCSttNd && pCEndNd )
             {
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index fcfda18576d4..553a6f1e114a 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -554,9 +554,11 @@ SwUndoUpdateIndex::~SwUndoUpdateIndex() = default;
 
 void SwUndoUpdateIndex::TitleSectionInserted(SwSectionFormat & rFormat)
 {
+#ifndef NDEBUG
     SwNodeIndex const tmp(rFormat.GetDoc()->GetNodes(), m_nStartIndex); // 
title inserted before empty node
     assert(tmp.GetNode().IsSectionNode());
     assert(tmp.GetNode().GetSectionNode()->GetSection().GetFormat() == 
&rFormat);
+#endif
     
m_pTitleSectionUpdated.reset(static_cast<SwUndoDelSection*>(MakeUndoDelSection(rFormat).release()));
 }
 
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 5195e1484de3..247959a1d267 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5080,8 +5080,6 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 
     size_t nPageDescOffset = m_rDoc.GetPageDescCnt();
 
-    SwNodeIndex aSttNdIdx( m_rDoc.GetNodes() );
-
     RedlineFlags eMode = RedlineFlags::ShowInsert | RedlineFlags::ShowDelete;
 
     m_xSprmParser.reset(new wwSprmParser(*m_xWwFib));
@@ -5097,9 +5095,6 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 
     m_bWWBugNormal = m_xWwFib->m_nProduct == 0xc03d;
 
-    if (!m_bNewDoc)
-        aSttNdIdx = m_pPaM->GetPoint()->nNode;
-
     m_xProgress.reset(new ImportProgress(m_pDocShell, 0, 100));
 
     // read Font Table

Reply via email to