sw/source/core/crsr/findattr.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 436c37e6995c70af8ead81bb69b7692f8ef65912
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Sep 29 12:53:59 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 29 16:07:36 2022 +0200

    use more SwPosition::SetContent
    
    part of the process of hiding the internals of SwPosition
    
    Change-Id: Id3a0105f0566db54fcbbf50f829094ca6ac3bcca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140731
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 79f9e5751906..85811c012538 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -1021,7 +1021,7 @@ bool FindAttrImpl(SwPaM & rSearchPam,
             // always: incl. start and incl. end
             *rSearchPam.GetPoint() = *pPam->GetPoint();
             rSearchPam.SetMark();
-            pNode->MakeEndIndex( &rSearchPam.GetPoint()->nContent );
+            rSearchPam.GetPoint()->SetContent(pNode->Len());
             bFound = true;
             break;
         }
@@ -1204,11 +1204,11 @@ static bool FindAttrsImpl(SwPaM & rSearchPam,
                 rSearchPam.SetMark();
                 if (bSrchForward)
                 {
-                    pNode->MakeEndIndex( &rSearchPam.GetPoint()->nContent );
+                    rSearchPam.GetPoint()->SetContent(pNode->Len());
                 }
                 else
                 {
-                    pNode->MakeStartIndex( &rSearchPam.GetPoint()->nContent );
+                    rSearchPam.GetPoint()->SetContent(0);
                 }
             }
             bFound = true;
@@ -1328,8 +1328,8 @@ int SwFindParaAttr::DoFind(SwPaM & rCursor, 
SwMoveFnCollection const & fnMove,
     {
         const bool bRegExp(
                 SearchAlgorithms2::REGEXP == pSearchOpt->AlgorithmType2);
-        SwContentIndex& rSttCntIdx = rCursor.Start()->nContent;
-        const sal_Int32 nSttCnt = rSttCntIdx.GetIndex();
+        SwPosition& rSttCntPos = *rCursor.Start();
+        const sal_Int32 nSttCnt = rSttCntPos.GetContentIndex();
 
         // add to shell-cursor-ring so that the regions will be moved 
eventually
         SwPaM* pPrevRing(nullptr);
@@ -1359,7 +1359,7 @@ int SwFindParaAttr::DoFind(SwPaM & rCursor, 
SwMoveFnCollection const & fnMove,
                 p->MoveTo(const_cast<SwPaM*>(&rRegion));
             } while( p != pPrevRing );
         }
-        rSttCntIdx = nSttCnt;
+        rSttCntPos.SetContent(nSttCnt);
     }
 
     if( bReplaceAttr )

Reply via email to