summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-12-04 14:20:02 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-12-18 17:55:29 +0100
commit92560b2d0149397ac5417522a37ce995691c7050 (patch)
treee27dac9af0d0c99d5a2e19da6747a797412491c7 /sw/inc
parent1b4fdcf1b13c0be54cd4c4423122580948445069 (diff)
sw: refactor a confusing thicket of overloads, all named Find()
Also, some of these don't really make much sense as member functions of SwPaM, so make them plain functions instead. Also, some pointer parameters are never null, but there is code to handle that case in MakeRegion(); simplify that. Change-Id: I822e814b0cab14f7f31cfa33478ed15774405a61
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/crsrsh.hxx7
-rw-r--r--sw/inc/pam.hxx31
-rw-r--r--sw/inc/swcrsr.hxx12
3 files changed, 10 insertions, 40 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 327674e3c547..fca0cc4f78f5 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -358,18 +358,19 @@ public:
void MoveColumn( SwWhichColumn, SwPosColumn );
bool MoveRegion( SwWhichRegion, SwMoveFnCollection const & );
- sal_uLong Find( const i18nutil::SearchOptions2& rSearchOpt,
+ // note: DO NOT call it FindText because windows.h
+ sal_uLong Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnd,
bool& bCancel,
FindRanges eRng, bool bReplace = false );
- sal_uLong Find( const SwTextFormatColl& rFormatColl,
+ sal_uLong FindFormat( const SwTextFormatColl& rFormatColl,
SwDocPositions eStart, SwDocPositions eEnd,
bool& bCancel,
FindRanges eRng, const SwTextFormatColl* pReplFormat );
- sal_uLong Find( const SfxItemSet& rSet, bool bNoCollections,
+ sal_uLong FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
SwDocPositions eStart, SwDocPositions eEnd,
bool& bCancel,
FindRanges eRng,
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index c71667e30f50..c7bc752ff347 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -27,18 +27,9 @@
#include <iostream>
-class SwFormat;
-class SfxPoolItem;
-class SfxItemSet;
class SwDoc;
class SwPaM;
class Point;
-namespace i18nutil {
- struct SearchOptions2;
-}
-namespace utl {
- class TextSearch;
-}
/// Marks a position in the document model.
struct SAL_WARN_UNUSED SW_DLLPUBLIC SwPosition
@@ -150,8 +141,6 @@ class SAL_WARN_UNUSED SW_DLLPUBLIC SwPaM : public sw::Ring<SwPaM>
SwPosition * m_pMark; ///< points at either m_Bound1 or m_Bound2
bool m_bIsInFrontOfLabel;
- std::unique_ptr<SwPaM> MakeRegion( SwMoveFnCollection const & fnMove, const SwPaM * pOrigRg );
-
SwPaM(SwPaM const& rPaM) = delete;
public:
@@ -179,26 +168,6 @@ public:
bool Move( SwMoveFnCollection const & fnMove = fnMoveForward,
SwGoInDoc fnGo = GoInContent );
- /// Search.
- bool Find( const i18nutil::SearchOptions2& rSearchOpt,
- bool bSearchInNotes,
- utl::TextSearch& rSText,
- SwMoveFnCollection const & fnMove,
- const SwPaM *pPam, bool bInReadOnly = false);
- bool Find( const SwFormat& rFormat,
- SwMoveFnCollection const & fnMove,
- const SwPaM *pPam, bool bInReadOnly = false);
- bool Find( const SfxPoolItem& rAttr, bool bValue,
- SwMoveFnCollection const & fnMove,
- const SwPaM *pPam, bool bInReadOnly = false );
- bool Find( const SfxItemSet& rAttr, bool bNoColls,
- SwMoveFnCollection const & fnMove,
- const SwPaM *pPam, bool bInReadOnly, bool bMoveFirst );
-
- bool DoSearch( const i18nutil::SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
- SwMoveFnCollection const & fnMove, bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd,
- sal_Int32 &nStart, sal_Int32 &nEnd, sal_Int32 nTextLen, SwNode* pNode, SwPaM* pPam);
-
bool IsInFrontOfLabel() const { return m_bIsInFrontOfLabel; }
void SetInFrontOfLabel_( bool bNew ) { m_bIsInFrontOfLabel = bNew; }
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index c463fdf37b33..9267ba0f10a0 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -23,6 +23,7 @@
#include "tblsel.hxx"
#include "cshtyp.hxx"
+class SfxItemSet;
struct SwCursor_SavePos;
namespace i18nutil {
struct SearchOptions2;
@@ -36,7 +37,7 @@ const int FIND_NO_RING = 2;
struct SwFindParas
{
- virtual int Find( SwPaM*, SwMoveFnCollection const &, const SwPaM*, bool ) = 0;
+ virtual int DoFind(SwPaM &, SwMoveFnCollection const &, const SwPaM&, bool) = 0;
virtual bool IsReplaceMode() const = 0;
protected:
@@ -75,8 +76,6 @@ class SW_DLLPUBLIC SwCursor : public SwPaM
sal_uLong FindAll( SwFindParas& , SwDocPositions, SwDocPositions, FindRanges, bool& bCancel );
- using SwPaM::Find;
-
SwCursor(SwCursor const& rPaM) = delete;
protected:
@@ -112,18 +111,19 @@ public:
SwMoveFnCollection const & MakeFindRange( SwDocPositions, SwDocPositions,
SwPaM* ) const;
- sal_uLong Find( const i18nutil::SearchOptions2& rSearchOpt,
+ // note: DO NOT call it FindText because windows.h
+ sal_uLong Find_Text( const i18nutil::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
SwDocPositions nStart, SwDocPositions nEnde,
bool& bCancel,
FindRanges,
bool bReplace = false );
- sal_uLong Find( const SwTextFormatColl& rFormatColl,
+ sal_uLong FindFormat( const SwTextFormatColl& rFormatColl,
SwDocPositions nStart, SwDocPositions nEnde,
bool& bCancel,
FindRanges,
const SwTextFormatColl* pReplFormat );
- sal_uLong Find( const SfxItemSet& rSet, bool bNoCollections,
+ sal_uLong FindAttrs( const SfxItemSet& rSet, bool bNoCollections,
SwDocPositions nStart, SwDocPositions nEnde,
bool& bCancel,
FindRanges,