From 390c7b97ad674a8281735980120733a48e5d89a3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 19 Aug 2022 10:32:42 +0200 Subject: use more SwPosition::GetContentIndex part of the process of hiding the internals of SwPosition Change-Id: Iaf038c006fc9f82073664536278aac4d44754340 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138512 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/doc/docbm.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sw/source/core/doc/docbm.cxx') diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 2da73745fb2f..52461872b6e0 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -190,7 +190,7 @@ namespace return oContentIdx.has_value() ? ( rPos.GetNode() > rNdIdx || ( rPos.GetNode() == rNdIdx - && rPos.nContent >= *oContentIdx ) ) + && rPos.GetContentIndex() >= *oContentIdx ) ) : rPos.GetNode() >= rNdIdx; } @@ -199,7 +199,7 @@ namespace return rPos.GetNode() < rNdIdx || ( oContentIdx.has_value() && rPos.GetNode() == rNdIdx - && rPos.nContent < *oContentIdx ); + && rPos.GetContentIndex() < *oContentIdx ); } bool lcl_MarkOrderingByStart(const ::sw::mark::MarkBase *const pFirst, @@ -998,11 +998,11 @@ namespace sw::mark if ( oEndContentIdx.has_value() && ( ( rbIsOtherPosInRange && pMark->GetMarkPos().GetNode() == rEnd - && pMark->GetMarkPos().nContent == *oEndContentIdx ) + && pMark->GetMarkPos().GetContentIndex() == *oEndContentIdx ) || ( rbIsPosInRange && pMark->IsExpanded() && pMark->GetOtherMarkPos().GetNode() == rEnd - && pMark->GetOtherMarkPos().nContent == *oEndContentIdx ) ) ) + && pMark->GetOtherMarkPos().GetContentIndex() == *oEndContentIdx ) ) ) { rbIsPosInRange = true; rbIsOtherPosInRange = true; @@ -1029,7 +1029,7 @@ namespace sw::mark || pMark->IsExpanded() || !oStartContentIdx.has_value() || pMark->GetMarkPos().nNode != rStt - || pMark->GetMarkPos().nContent != *oStartContentIdx; + || pMark->GetMarkPos().GetContentIndex() != *oStartContentIdx; break; default: bDeleteMark = true; @@ -1782,7 +1782,8 @@ namespace { bool lcl_Greater( const SwPosition& rPos, const SwNode& rNdIdx, std::optional oContentIdx ) { - return rPos.GetNode() > rNdIdx || ( oContentIdx && rPos.GetNode() == rNdIdx && rPos.nContent > *oContentIdx ); + return rPos.GetNode() > rNdIdx || + ( oContentIdx && rPos.GetNode() == rNdIdx && rPos.GetContentIndex() > *oContentIdx ); } } -- cgit