sw/source/core/crsr/findtxt.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 397cacaa13dd8c102fb467a0c769597a60a2cfbf
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Fri Mar 15 12:40:42 2024 -0400
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 15 20:29:21 2024 +0100

    DoSearch's pPam was not optional - made it an SwPam& rPam
    
    oPam also is not a real optional - it is always populated
    by MakeRegion, and known to be non-null since it was used
    in the containing while loop clause earlier
    
    Change-Id: I33133c8f9f9188e57fe100f3c455dc92453d05f4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164868
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>
    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 5f63f8f13694..9d05c3290e50 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -361,7 +361,7 @@ static bool DoSearch(SwPaM & rSearchPam,
     bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd,
     AmbiguousIndex & nStart, AmbiguousIndex & nEnd, AmbiguousIndex nTextLen,
     SwTextNode const* pNode, SwTextFrame const* pTextFrame,
-    SwRootFrame const* pLayout, SwPaM* pPam);
+    SwRootFrame const* pLayout, SwPaM& rPam);
 
 namespace sw {
 
@@ -677,7 +677,7 @@ bool FindTextImpl(SwPaM & rSearchPam,
                                        bRegSearch, bChkEmptyPara, bChkParaEnd,
                                        nStartInside, nEndInside, nTextLen,
                                        pNode->GetTextNode(), pFrame, pLayout,
-                                       oPam ? &*oPam : nullptr );
+                                       *oPam);
                     if ( bFound )
                         break;
                     else
@@ -710,7 +710,7 @@ bool FindTextImpl(SwPaM & rSearchPam,
                                    bRegSearch, bChkEmptyPara, bChkParaEnd,
                                    nStart, nEnd, nTextLen,
                                    pNode->GetTextNode(), pFrame, pLayout,
-                                   oPam ? &*oPam : nullptr );
+                                   *oPam);
             }
             if (bFound)
                 break;
@@ -727,10 +727,10 @@ bool DoSearch(SwPaM & rSearchPam,
                       bool bChkEmptyPara, bool bChkParaEnd,
         AmbiguousIndex & nStart, AmbiguousIndex & nEnd, AmbiguousIndex const 
nTextLen,
         SwTextNode const*const pNode, SwTextFrame const*const pFrame,
-        SwRootFrame const*const pLayout, SwPaM* pPam)
+        SwRootFrame const*const pLayout, SwPaM& rPam)
 {
     bool bFound = false;
-    SwPosition& rPtPos = *pPam->GetPoint();
+    SwPosition& rPtPos = *rPam.GetPoint();
     OUString sCleanStr;
     std::vector<AmbiguousIndex> aFltArr;
     LanguageType eLastLang = LANGUAGE_SYSTEM;
@@ -818,7 +818,7 @@ bool DoSearch(SwPaM & rSearchPam,
             nStart = nProxyStart;
             nEnd = nProxyEnd;
             // set section correctly
-            *rSearchPam.GetPoint() = *pPam->GetPoint();
+            *rSearchPam.GetPoint() = *rPam.GetPoint();
             rSearchPam.SetMark();
 
             // adjust start and end
@@ -875,7 +875,7 @@ bool DoSearch(SwPaM & rSearchPam,
     else if ((bChkEmptyPara && !nStart.GetAnyIndex() && 
!nTextLen.GetAnyIndex())
              || bChkParaEnd)
     {
-        *rSearchPam.GetPoint() = *pPam->GetPoint();
+        *rSearchPam.GetPoint() = *rPam.GetPoint();
         if (pLayout)
         {
             *rSearchPam.GetPoint() = pFrame->MapViewToModelPos(

Reply via email to