sw/source/core/crsr/findtxt.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
New commits: commit c2509337d573a8eaaa852db155962238af3a5b99 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Aug 29 09:59:40 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Aug 29 12:16:39 2022 +0200 use more SwPosition::Assign part of hiding the internals of SwPosition Change-Id: Ib1a31abd1e4fc8483a8ef799accb8a245bb6352b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138965 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index b572d95d9e04..d8bac04f2f85 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -379,8 +379,7 @@ bool FindTextImpl(SwPaM & rSearchPam, std::optional<SwPaM> oPam; sw::MakeRegion(fnMove, rRegion, oPam); const bool bSrchForward = &fnMove == &fnMoveForward; - SwNodeIndex& rNdIdx = oPam->GetPoint()->nNode; - SwContentIndex& rContentIdx = oPam->GetPoint()->nContent; + SwPosition& rPtPos = *oPam->GetPoint(); // If bFound is true then the string was found and is between nStart and nEnd bool bFound = false; @@ -423,7 +422,7 @@ bool FindTextImpl(SwPaM & rSearchPam, AmbiguousIndex nEnd; if (pLayout ? FrameContainsNode(*pFrame, oPam->GetMark()->GetNodeIndex()) - : rNdIdx == oPam->GetMark()->nNode) + : rPtPos.GetNode() == oPam->GetMark()->GetNode()) { if (pLayout) { @@ -459,7 +458,7 @@ bool FindTextImpl(SwPaM & rSearchPam, } else { - nStart.SetModelIndex(rContentIdx.GetIndex()); + nStart.SetModelIndex(rPtPos.GetContentIndex()); } /* #i80135# */ @@ -566,16 +565,15 @@ bool FindTextImpl(SwPaM & rSearchPam, aPaM.SetMark(); if (pLayout) { - aPaM.GetMark()->nNode = (pFrame->GetMergedPara() + aPaM.GetMark()->Assign( (pFrame->GetMergedPara() ? *pFrame->GetMergedPara()->pLastNode : rTextNode) - .GetIndex() + 1; + .GetIndex() + 1 ); } else { - aPaM.GetMark()->nNode = rTextNode.GetIndex() + 1; + aPaM.GetMark()->Assign( rTextNode.GetIndex() + 1 ); } - aPaM.GetMark()->nContent.Assign(aPaM.GetMark()->GetNode().GetTextNode(), 0); if (pNode->GetDoc().getIDocumentDrawModelAccess().Search(aPaM, *xSearchItem) && pSdrView) { if (SdrObject* pObject = pSdrView->GetTextEditObject())