summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-22 15:44:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-23 08:02:39 +0200
commit0c6c95b545b6d4bced699e6f7d9e1d9c679b893e (patch)
treef3066a9d68d33dd60d6c65e60e3040cce4b88e94
parent782e4502898924eb94c4ff7f6c33d9ef36959f02 (diff)
add a new SwContentNode::GoNext variant
that takes a SwPosition and keeps the nNode and nContent fields there in sync. this is part of the process of hiding the internals of SwPosition. Change-Id: I1996e588703ca2400fa84e979c72cc5382e5b700 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140435 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/node.hxx1
-rw-r--r--sw/source/core/doc/docruby.cxx2
-rw-r--r--sw/source/core/docnode/node.cxx9
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 68a33263124f..e6176ce5b91b 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -415,6 +415,7 @@ public:
void MakeEndIndex( SwContentIndex * pIdx ) { pIdx->Assign( this, Len() ); }
bool GoNext(SwContentIndex *, SwCursorSkipMode nMode ) const;
+ bool GoNext(SwPosition*, SwCursorSkipMode nMode ) const;
bool GoPrevious(SwContentIndex *, SwCursorSkipMode nMode ) const;
/// @see GetFrameOfModify
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index 07c11097f81c..1a1b84ffd7f4 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -303,7 +303,7 @@ bool SwDoc::SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry )
nWordEnd = nEnd;
}
}
- pTNd->GoNext( &pPos->nContent, SwCursorSkipMode::Chars );
+ pTNd->GoNext( pPos, SwCursorSkipMode::Chars );
nStart = pPos->GetContentIndex();
}
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 04d9e3f354bd..34586965475a 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1284,6 +1284,15 @@ SwFormatColl *SwContentNode::ChgFormatColl( SwFormatColl *pNewColl )
return pOldColl;
}
+bool SwContentNode::GoNext(SwPosition* pPos, SwCursorSkipMode nMode ) const
+{
+ if (!GoNext(&pPos->nContent, nMode))
+ return false;
+ if (pPos->nContent.GetContentNode() != &pPos->GetNode())
+ pPos->nNode.Assign(*pPos->nContent.GetContentNode());
+ return true;
+}
+
bool SwContentNode::GoNext(SwContentIndex * pIdx, SwCursorSkipMode nMode ) const
{
bool bRet = true;