summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-07-26 11:09:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-26 22:41:42 +0200
commitb13631c562e85a6567a600edc5bb1d93418e4f53 (patch)
tree58d71cb79dd75f7bedb612127072aea05c936d32 /sw
parent11cd74ade59c6b47b25a737775a541fdd6faed44 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/ndindex.hxx2
-rw-r--r--sw/source/core/doc/docredln.cxx1
-rw-r--r--sw/source/core/undo/unsect.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx5
4 files changed, 3 insertions, 7 deletions
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