sw/inc/crsrsh.hxx                    |    6 +++---
 sw/inc/swcrsr.hxx                    |    8 ++++----
 sw/qa/extras/uiwriter/uiwriter7.cxx  |   14 +++++++-------
 sw/source/core/crsr/crsrsh.cxx       |   12 ++++++------
 sw/source/core/crsr/findattr.cxx     |    4 ++--
 sw/source/core/crsr/findcoll.cxx     |    4 ++--
 sw/source/core/crsr/findtxt.cxx      |    4 ++--
 sw/source/core/crsr/swcrsr.cxx       |    8 ++++----
 sw/source/core/edit/edtox.cxx        |    2 +-
 sw/source/uibase/inc/wrtsh.hxx       |    6 +++---
 sw/source/uibase/uiview/viewsrch.cxx |    2 +-
 sw/source/uibase/uno/unotxdoc.cxx    |   20 ++++++++++----------
 sw/source/uibase/wrtsh/select.cxx    |   18 +++++++++---------
 13 files changed, 54 insertions(+), 54 deletions(-)

New commits:
commit 4d42aeae86253e167facb1adfddd0c9976b7801a
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jul 26 20:14:05 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Jul 26 22:43:25 2022 +0200

    sal_uLong->sal_Int32 in the Find/Search methods
    
    we cast this to sal_Int32 once it hits the UNO methods anyway
    
    Change-Id: I8d18330929acbb5b2f40d9b0fd0f49e087be867e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137483
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 61c2b9f07611..2a64da5f5d26 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -370,18 +370,18 @@ public:
     bool MoveRegion( SwWhichRegion, SwMoveFnCollection const & );
 
     // note: DO NOT call it FindText because windows.h
-    sal_uLong Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
+    sal_Int32 Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
                 bool bSearchInNotes,
                 SwDocPositions eStart, SwDocPositions eEnd,
                 bool& bCancel,
                 FindRanges eRng, bool bReplace = false );
 
-    sal_uLong FindFormat( const SwTextFormatColl& rFormatColl,
+    sal_Int32 FindFormat( const SwTextFormatColl& rFormatColl,
                 SwDocPositions eStart, SwDocPositions eEnd,
                 bool& bCancel,
                 FindRanges eRng, const SwTextFormatColl* pReplFormat );
 
-    sal_uLong FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
+    sal_Int32 FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
                 SwDocPositions eStart, SwDocPositions eEnd,
                 bool& bCancel,
                 FindRanges eRng,
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 0a2aafff36c7..27f42c0bd72d 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -76,7 +76,7 @@ class SW_DLLPUBLIC SwCursor : public SwPaM
     sal_uInt8 m_nCursorBidiLevel; // bidi level of the cursor
     bool m_bColumnSelection;      // true: cursor is aprt of a column selection
 
-    sal_uLong FindAll( SwFindParas& , SwDocPositions, SwDocPositions, 
FindRanges, bool& bCancel );
+    sal_Int32 FindAll( SwFindParas& , SwDocPositions, SwDocPositions, 
FindRanges, bool& bCancel );
 
     SwCursor(SwCursor const& rPaM) = delete;
 
@@ -114,20 +114,20 @@ public:
                                         SwPaM* ) const;
 
     // note: DO NOT call it FindText because windows.h
-    sal_uLong Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
+    sal_Int32 Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
                 bool bSearchInNotes,
                 SwDocPositions nStart, SwDocPositions nEnd,
                 bool& bCancel,
                 FindRanges,
                 bool bReplace = false,
                 SwRootFrame const*const pLayout = nullptr);
-    sal_uLong FindFormat( const SwTextFormatColl& rFormatColl,
+    sal_Int32 FindFormat( const SwTextFormatColl& rFormatColl,
                 SwDocPositions nStart, SwDocPositions nEnd,
                 bool& bCancel,
                 FindRanges,
                 const SwTextFormatColl* pReplFormat,
                 SwRootFrame const*const pLayout = nullptr);
-    sal_uLong FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
+    sal_Int32 FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
                 SwDocPositions nStart, SwDocPositions nEnd,
                 bool& bCancel,
                 FindRanges,
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 89a68b86e2bc..41a84f5bc264 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -684,7 +684,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, 
testSearchWithTransliterate)
     SearchOpt.AlgorithmType2 = css::util::SearchAlgorithms2::ABSOLUTE;
     SearchOpt.WildcardEscapeCharacter = 0;
     //transliteration option set so that at least one of the search strings is 
not found
-    sal_uLong case1
+    sal_Int32 case1
         = pWrtShell->SearchPattern(SearchOpt, true, SwDocPositions::Start, 
SwDocPositions::End);
     SwShellCursor* pShellCursor = pWrtShell->getShellCursor(true);
     CPPUNIT_ASSERT_EQUAL(OUString(), pShellCursor->GetText());
@@ -692,7 +692,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, 
testSearchWithTransliterate)
     SearchOpt.searchString = "paragraph";
     SearchOpt.transliterateFlags = TransliterationFlags::IGNORE_KASHIDA_CTL;
     //transliteration option set so that all search strings are found
-    sal_uLong case2
+    sal_Int32 case2
         = pWrtShell->SearchPattern(SearchOpt, true, SwDocPositions::Start, 
SwDocPositions::End);
     pShellCursor = pWrtShell->getShellCursor(true);
     CPPUNIT_ASSERT_EQUAL(OUString("paragraph"), pShellCursor->GetText());
@@ -721,27 +721,27 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf73660)
     //case 1
     searchOpt.searchString = "First";
     CPPUNIT_ASSERT_EQUAL(
-        sal_uLong(1),
+        sal_Int32(1),
         pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, 
SwDocPositions::End));
     //case 2
     searchOpt.searchString = "Second";
     CPPUNIT_ASSERT_EQUAL(
-        sal_uLong(1),
+        sal_Int32(1),
         pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, 
SwDocPositions::End));
     //case 3
     searchOpt.searchString = "Third";
     CPPUNIT_ASSERT_EQUAL(
-        sal_uLong(1),
+        sal_Int32(1),
         pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, 
SwDocPositions::End));
     //case 4
     searchOpt.searchString = "Fourth";
     CPPUNIT_ASSERT_EQUAL(
-        sal_uLong(1),
+        sal_Int32(1),
         pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, 
SwDocPositions::End));
     //case 5
     searchOpt.searchString = "Fifth";
     CPPUNIT_ASSERT_EQUAL(
-        sal_uLong(1),
+        sal_Int32(1),
         pWrtShell->SearchPattern(searchOpt, true, SwDocPositions::Start, 
SwDocPositions::End));
 }
 
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 64c923eadfe7..601906cff29f 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3487,7 +3487,7 @@ bool SwCursorShell::SelectHiddenRange()
     return bRet;
 }
 
-sal_uLong SwCursorShell::Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
+sal_Int32 SwCursorShell::Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
                              bool bSearchInNotes,
                              SwDocPositions eStart, SwDocPositions eEnd,
                              bool& bCancel,
@@ -3499,14 +3499,14 @@ sal_uLong SwCursorShell::Find_Text( const 
i18nutil::SearchOptions2& rSearchOpt,
     delete m_pTableCursor;
     m_pTableCursor = nullptr;
     SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed
-    sal_uLong nRet = m_pCurrentCursor->Find_Text(rSearchOpt, bSearchInNotes, 
eStart, eEnd,
+    sal_Int32 nRet = m_pCurrentCursor->Find_Text(rSearchOpt, bSearchInNotes, 
eStart, eEnd,
                                      bCancel, eRng, bReplace, GetLayout());
     if( nRet || bCancel )
         UpdateCursor();
     return nRet;
 }
 
-sal_uLong SwCursorShell::FindFormat( const SwTextFormatColl& rFormatColl,
+sal_Int32 SwCursorShell::FindFormat( const SwTextFormatColl& rFormatColl,
                              SwDocPositions eStart, SwDocPositions eEnd,
                              bool& bCancel,
                              FindRanges eRng,
@@ -3517,14 +3517,14 @@ sal_uLong SwCursorShell::FindFormat( const 
SwTextFormatColl& rFormatColl,
     delete m_pTableCursor;
     m_pTableCursor = nullptr;
     SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed
-    sal_uLong nRet = m_pCurrentCursor->FindFormat(rFormatColl, eStart, eEnd, 
bCancel, eRng,
+    sal_Int32 nRet = m_pCurrentCursor->FindFormat(rFormatColl, eStart, eEnd, 
bCancel, eRng,
                                      pReplFormat );
     if( nRet )
         UpdateCursor();
     return nRet;
 }
 
-sal_uLong SwCursorShell::FindAttrs( const SfxItemSet& rSet,
+sal_Int32 SwCursorShell::FindAttrs( const SfxItemSet& rSet,
                              bool bNoCollections,
                              SwDocPositions eStart, SwDocPositions eEnd,
                              bool& bCancel,
@@ -3537,7 +3537,7 @@ sal_uLong SwCursorShell::FindAttrs( const SfxItemSet& 
rSet,
     delete m_pTableCursor;
     m_pTableCursor = nullptr;
     SwCallLink aLk( *this ); // watch Cursor-Moves; call Link if needed
-    sal_uLong nRet = m_pCurrentCursor->FindAttrs(rSet, bNoCollections, eStart, 
eEnd,
+    sal_Int32 nRet = m_pCurrentCursor->FindAttrs(rSet, bNoCollections, eStart, 
eEnd,
                          bCancel, eRng, pSearchOpt, rReplSet, GetLayout());
     if( nRet )
         UpdateCursor();
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index efd72c3c92d6..1e89850ab4e8 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -1405,7 +1405,7 @@ bool SwFindParaAttr::IsReplaceMode() const
 }
 
 /// search for attributes
-sal_uLong SwCursor::FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
+sal_Int32 SwCursor::FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
                           SwDocPositions nStart, SwDocPositions nEnd,
                           bool& bCancel, FindRanges eFndRngs,
                           const i18nutil::SearchOptions2* pSearchOpt,
@@ -1429,7 +1429,7 @@ sal_uLong SwCursor::FindAttrs( const SfxItemSet& rSet, 
bool bNoCollections,
     SwFindParaAttr aSwFindParaAttr( rSet, bNoCollections, pSearchOpt,
                                     pReplSet, *this, pLayout );
 
-    sal_uLong nRet = FindAll( aSwFindParaAttr, nStart, nEnd, eFndRngs, bCancel 
);
+    sal_Int32 nRet = FindAll( aSwFindParaAttr, nStart, nEnd, eFndRngs, bCancel 
);
     rDoc.SetOle2Link( aLnk );
     if( nRet && bReplace )
         rDoc.getIDocumentState().SetModified();
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index ad43b7afec44..31a64aa3313f 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -72,7 +72,7 @@ bool SwFindParaFormatColl::IsReplaceMode() const
 }
 
 /// search for Format-Collections
-sal_uLong SwCursor::FindFormat( const SwTextFormatColl& rFormatColl, 
SwDocPositions nStart,
+sal_Int32 SwCursor::FindFormat( const SwTextFormatColl& rFormatColl, 
SwDocPositions nStart,
                           SwDocPositions nEnd, bool& bCancel,
                           FindRanges eFndRngs, const SwTextFormatColl* 
pReplFormatColl,
                           SwRootFrame const*const pLayout)
@@ -97,7 +97,7 @@ sal_uLong SwCursor::FindFormat( const SwTextFormatColl& 
rFormatColl, SwDocPositi
 
     SwFindParaFormatColl aSwFindParaFormatColl(rFormatColl, pReplFormatColl, 
pLayout);
 
-    sal_uLong nRet = FindAll( aSwFindParaFormatColl, nStart, nEnd, eFndRngs, 
bCancel );
+    sal_Int32 nRet = FindAll( aSwFindParaFormatColl, nStart, nEnd, eFndRngs, 
bCancel );
     rDoc.SetOle2Link( aLnk );
 
     if( nRet && pReplFormatColl )
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 8ef922d70c0c..fb44e7b95c97 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -1006,7 +1006,7 @@ bool SwFindParaText::IsReplaceMode() const
     return m_bReplace;
 }
 
-sal_uLong SwCursor::Find_Text( const i18nutil::SearchOptions2& rSearchOpt, 
bool bSearchInNotes,
+sal_Int32 SwCursor::Find_Text( const i18nutil::SearchOptions2& rSearchOpt, 
bool bSearchInNotes,
                           SwDocPositions nStart, SwDocPositions nEnd,
                           bool& bCancel, FindRanges eFndRngs, bool bReplace,
                           SwRootFrame const*const pLayout)
@@ -1026,7 +1026,7 @@ sal_uLong SwCursor::Find_Text( const 
i18nutil::SearchOptions2& rSearchOpt, bool
     if( bSearchSel )
         eFndRngs = static_cast<FindRanges>(eFndRngs | FindRanges::InSel);
     SwFindParaText aSwFindParaText(rSearchOpt, bSearchInNotes, bReplace, 
*this, pLayout);
-    sal_uLong nRet = FindAll( aSwFindParaText, nStart, nEnd, eFndRngs, bCancel 
);
+    sal_Int32 nRet = FindAll( aSwFindParaText, nStart, nEnd, eFndRngs, bCancel 
);
     rDoc.SetOle2Link( aLnk );
     if( nRet && bReplace )
         rDoc.getIDocumentState().SetModified();
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index b4a873449a83..6a54a17dfcd3 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -760,7 +760,7 @@ SwMoveFnCollection const & SwCursor::MakeFindRange( 
SwDocPositions nStart,
                 ? fnMoveForward : fnMoveBackward;
 }
 
-static sal_uLong lcl_FindSelection( SwFindParas& rParas, SwCursor* 
pCurrentCursor,
+static sal_Int32 lcl_FindSelection( SwFindParas& rParas, SwCursor* 
pCurrentCursor,
                         SwMoveFnCollection const & fnMove, SwCursor*& pFndRing,
                         SwPaM& aRegion, FindRanges eFndRngs,
                         bool bInReadOnly, bool& bCancel )
@@ -768,7 +768,7 @@ static sal_uLong lcl_FindSelection( SwFindParas& rParas, 
SwCursor* pCurrentCurso
     SwDoc& rDoc = pCurrentCursor->GetDoc();
     bool const bDoesUndo = rDoc.GetIDocumentUndoRedo().DoesUndo();
     int nFndRet = 0;
-    sal_uLong nFound = 0;
+    sal_Int32 nFound = 0;
     const bool bSrchBkwrd = &fnMove == &fnMoveBackward;
     SwPaM *pTmpCursor = pCurrentCursor, *pSaveCursor = pCurrentCursor;
     std::unique_ptr<SvxSearchItem> xSearchItem;
@@ -951,7 +951,7 @@ static bool lcl_MakeSelBkwrd( const SwNode& rSttNd, const 
SwNode& rEndNd,
 
 // this method "searches" for all use cases because in SwFindParas is always 
the
 // correct parameters and respective search method
-sal_uLong SwCursor::FindAll( SwFindParas& rParas,
+sal_Int32 SwCursor::FindAll( SwFindParas& rParas,
                             SwDocPositions nStart, SwDocPositions nEnd,
                             FindRanges eFndRngs, bool& bCancel )
 {
@@ -962,7 +962,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
     SwPaM aRegion( *GetPoint() );
     SwMoveFnCollection const & fnMove = MakeFindRange( nStart, nEnd, &aRegion 
);
 
-    sal_uLong nFound = 0;
+    sal_Int32 nFound = 0;
     const bool bMvBkwrd = &fnMove == &fnMoveBackward;
     bool bInReadOnly = IsReadOnlyAvailable();
     std::unique_ptr<SvxSearchItem> xSearchItem;
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 1a9c4ba213f7..38c9e7dd82be 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -364,7 +364,7 @@ void SwEditShell::ApplyAutoMark()
                     bool bCancel;
 
                     // todo/mba: assuming that notes shouldn't be searched
-                    sal_uLong nRet = Find_Text(aSearchOpt, 
false/*bSearchInNotes*/, SwDocPositions::Start, SwDocPositions::End, bCancel,
+                    sal_Int32 nRet = Find_Text(aSearchOpt, 
false/*bSearchInNotes*/, SwDocPositions::Start, SwDocPositions::End, bCancel,
                                     FindRanges::InSelAll );
 
                     if(nRet)
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 7ab293ae219f..db1b89822eb3 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -384,18 +384,18 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
     void    GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) 
const;
 
     // search and replace
-    sal_uLong SearchPattern(const i18nutil::SearchOptions2& rSearchOpt,
+    sal_Int32 SearchPattern(const i18nutil::SearchOptions2& rSearchOpt,
                          bool bSearchInNotes,
                          SwDocPositions eStart, SwDocPositions eEnd,
                          FindRanges eFlags = FindRanges::InBody,
                          bool bReplace = false );
 
-    sal_uLong SearchTempl  (const OUString &rTempl,
+    sal_Int32 SearchTempl  (const OUString &rTempl,
                          SwDocPositions eStart, SwDocPositions eEnd,
                          FindRanges eFlags = FindRanges::InBody,
                          const OUString* pReplTempl = nullptr );
 
-    sal_uLong SearchAttr   (const SfxItemSet& rFindSet,
+    sal_Int32 SearchAttr   (const SfxItemSet& rFindSet,
                          bool bNoColls,
                          SwDocPositions eStart, SwDocPositions eEnd,
                          FindRanges eFlags = FindRanges::InBody,
diff --git a/sw/source/uibase/uiview/viewsrch.cxx 
b/sw/source/uibase/uiview/viewsrch.cxx
index 04831dfccac9..0ca7c9028310 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -782,7 +782,7 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& 
rOptions )
     if( !bDoReplace )
         aSearchOpt.replaceString.clear();
 
-    sal_uLong nFound;
+    sal_Int32 nFound;
     if( aSrchSet.Count() || ( xReplSet && xReplSet->Count() ))
     {
         nFound = m_pWrtShell->SearchAttr(
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 9cd713820290..7a6dea5d614d 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -696,7 +696,7 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< 
util::XSearchDescriptor >
 
     // Search should take place anywhere
     pUnoCursor->SetRemainInSection(false);
-    sal_uInt32 nResult;
+    sal_Int32 nResult;
     UnoActionContext aContext(m_pDocShell->GetDoc());
     //try attribute search first
     if(pSearch->HasSearchAttributes()||pSearch->HasReplaceAttributes())
@@ -710,11 +710,11 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< 
util::XSearchDescriptor >
         pSearch->FillSearchItemSet(aSearch);
         pSearch->FillReplaceItemSet(aReplace);
         bool bCancel;
-        nResult = static_cast<sal_Int32>(pUnoCursor->FindAttrs(aSearch, 
!pSearch->m_bStyles,
+        nResult = pUnoCursor->FindAttrs(aSearch, !pSearch->m_bStyles,
                     eStart, eEnd, bCancel,
                     static_cast<FindRanges>(eRanges),
                     !pSearch->m_sSearchText.isEmpty() ? &aSearchOpt : nullptr,
-                    &aReplace ));
+                    &aReplace );
     }
     else if(pSearch->m_bStyles)
     {
@@ -736,7 +736,7 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< 
util::XSearchDescriptor >
             static_cast<FindRanges>(eRanges),
             true );
     }
-    return static_cast<sal_Int32>(nResult);
+    return nResult;
 
 }
 
@@ -823,10 +823,10 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< 
util::XSearchDescriptor >
                  aSearch( m_pDocShell->GetDoc()->GetAttrPool() );
             pSearch->FillSearchItemSet(aSearch);
             bool bCancel;
-            nResult = static_cast<sal_Int32>(pUnoCursor->FindAttrs(aSearch, 
!pSearch->m_bStyles,
+            nResult = pUnoCursor->FindAttrs(aSearch, !pSearch->m_bStyles,
                         eStart, eEnd, bCancel,
                         eRanges,
-                        !pSearch->m_sSearchText.isEmpty() ? &aSearchOpt : 
nullptr ));
+                        !pSearch->m_sSearchText.isEmpty() ? &aSearchOpt : 
nullptr );
         }
         else if(pSearch->m_bStyles)
         {
@@ -834,17 +834,17 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< 
util::XSearchDescriptor >
             //pSearch->sReplaceText
             SwTextFormatColl *pReplaceColl = nullptr;
             bool bCancel;
-            nResult = 
static_cast<sal_Int32>(pUnoCursor->FindFormat(*pSearchColl,
+            nResult = pUnoCursor->FindFormat(*pSearchColl,
                         eStart, eEnd, bCancel,
-                        eRanges, pReplaceColl ));
+                        eRanges, pReplaceColl );
         }
         else
         {
             //todo/mba: assuming that notes should be omitted
             bool bCancel;
-            nResult = static_cast<sal_Int32>(pUnoCursor->Find_Text(aSearchOpt, 
false/*bSearchInNotes*/,
+            nResult = pUnoCursor->Find_Text(aSearchOpt, 
false/*bSearchInNotes*/,
                     eStart, eEnd, bCancel,
-                    eRanges ));
+                    eRanges );
         }
         if(nResult || (eRanges&(FindRanges::InSelAll|FindRanges::InOther)))
             break;
diff --git a/sw/source/uibase/wrtsh/select.cxx 
b/sw/source/uibase/wrtsh/select.cxx
index 28d6384f7da2..a8df34c09dab 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -209,7 +209,7 @@ void SwWrtShell::SelAll()
 
 // Description: Text search
 
-sal_uLong SwWrtShell::SearchPattern( const i18nutil::SearchOptions2& 
rSearchOpt, bool bSearchInNotes,
+sal_Int32 SwWrtShell::SearchPattern( const i18nutil::SearchOptions2& 
rSearchOpt, bool bSearchInNotes,
                                 SwDocPositions eStt, SwDocPositions eEnd,
                                 FindRanges eFlags, bool bReplace )
 {
@@ -217,18 +217,18 @@ sal_uLong SwWrtShell::SearchPattern( const 
i18nutil::SearchOptions2& rSearchOpt,
     if(!(eFlags & FindRanges::InSel))
         ClearMark();
     bool bCancel = false;
-    sal_uLong nRet = Find_Text(rSearchOpt, bSearchInNotes, eStt, eEnd, 
bCancel, eFlags, bReplace);
+    sal_Int32 nRet = Find_Text(rSearchOpt, bSearchInNotes, eStt, eEnd, 
bCancel, eFlags, bReplace);
     if(bCancel)
     {
         Undo();
-        nRet = ULONG_MAX;
+        nRet = SAL_MAX_INT32;
     }
     return nRet;
 }
 
 // Description: search for templates
 
-sal_uLong SwWrtShell::SearchTempl( const OUString &rTempl,
+sal_Int32 SwWrtShell::SearchTempl( const OUString &rTempl,
                                SwDocPositions eStt, SwDocPositions eEnd,
                                FindRanges eFlags, const OUString* pReplTempl )
 {
@@ -241,19 +241,19 @@ sal_uLong SwWrtShell::SearchTempl( const OUString &rTempl,
         pReplaceColl = GetParaStyle(*pReplTempl, 
SwWrtShell::GETSTYLE_CREATESOME );
 
     bool bCancel = false;
-    sal_uLong nRet = FindFormat(pColl ? *pColl : GetDfltTextFormatColl(),
+    sal_Int32 nRet = FindFormat(pColl ? *pColl : GetDfltTextFormatColl(),
                                eStt,eEnd, bCancel, eFlags, pReplaceColl);
     if(bCancel)
     {
         Undo();
-        nRet = ULONG_MAX;
+        nRet = SAL_MAX_INT32;
     }
     return nRet;
 }
 
 // search for attributes
 
-sal_uLong SwWrtShell::SearchAttr( const SfxItemSet& rFindSet, bool bNoColls,
+sal_Int32 SwWrtShell::SearchAttr( const SfxItemSet& rFindSet, bool bNoColls,
                                 SwDocPositions eStart, SwDocPositions eEnd,
                                 FindRanges eFlags, const 
i18nutil::SearchOptions2* pSearchOpt,
                                 const SfxItemSet* pReplaceSet )
@@ -264,12 +264,12 @@ sal_uLong SwWrtShell::SearchAttr( const SfxItemSet& 
rFindSet, bool bNoColls,
 
     // Searching
     bool bCancel = false;
-    sal_uLong nRet = FindAttrs(rFindSet, bNoColls, eStart, eEnd, bCancel, 
eFlags, pSearchOpt, pReplaceSet);
+    sal_Int32 nRet = FindAttrs(rFindSet, bNoColls, eStart, eEnd, bCancel, 
eFlags, pSearchOpt, pReplaceSet);
 
     if(bCancel)
     {
         Undo();
-        nRet = ULONG_MAX;
+        nRet = SAL_MAX_INT32;
     }
     return nRet;
 }

Reply via email to