summaryrefslogtreecommitdiff
path: root/sw/inc/pam.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-30 11:48:07 +0200
committerNoel Grandin <noel@peralex.com>2016-08-31 10:00:07 +0200
commitfd405ab457183f1c0d48d47bbd3308edb2e30242 (patch)
treefaad42c1d8009c5d6118df7722216151a95b5812 /sw/inc/pam.hxx
parent4300656d9f0015c6a894b76ddcf537b446d0b9ba (diff)
remove the SwMoveFnCollection* typedefs
which were just obscuring the code, and pass it around by const& Change-Id: I4fce5ef4bf616867c46a145f660a8e90d3c94462
Diffstat (limited to 'sw/inc/pam.hxx')
-rw-r--r--sw/inc/pam.hxx41
1 files changed, 20 insertions, 21 deletions
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 05852095d627..fc25eed3d3ef 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -139,20 +139,19 @@ SwComparePosition ComparePosition(
/// SwPointAndMark / SwPaM
struct SwMoveFnCollection;
-typedef SwMoveFnCollection* SwMoveFn;
-SW_DLLPUBLIC extern SwMoveFn fnMoveForward; ///< SwPam::Move()/Find() default argument.
-SW_DLLPUBLIC extern SwMoveFn fnMoveBackward;
-
-// also works: using SwGoInDoc = bool (*) (SwPaM& rPam, SwMoveFn fnMove);
-// no works: using SwGoInDoc = [](SwPaM& rPam, SwMoveFn fnMove) -> bool;
-using SwGoInDoc = auto (*)(SwPaM& rPam, SwMoveFn fnMove) -> bool;
-SW_DLLPUBLIC bool GoInDoc( SwPaM&, SwMoveFn);
-SW_DLLPUBLIC bool GoInSection( SwPaM&, SwMoveFn);
-SW_DLLPUBLIC bool GoInNode( SwPaM&, SwMoveFn);
-SW_DLLPUBLIC bool GoInContent( SwPaM&, SwMoveFn);
-SW_DLLPUBLIC bool GoInContentCells( SwPaM&, SwMoveFn);
-SW_DLLPUBLIC bool GoInContentSkipHidden( SwPaM&, SwMoveFn);
-SW_DLLPUBLIC bool GoInContentCellsSkipHidden( SwPaM&, SwMoveFn);
+SW_DLLPUBLIC extern SwMoveFnCollection const & fnMoveForward; ///< SwPam::Move()/Find() default argument.
+SW_DLLPUBLIC extern SwMoveFnCollection const & fnMoveBackward;
+
+// also works: using SwGoInDoc = bool (*) (SwPaM& rPam, SwMoveFnCollection const & fnMove);
+// no works: using SwGoInDoc = [](SwPaM& rPam, SwMoveFnCollection const & fnMove) -> bool;
+using SwGoInDoc = auto (*)(SwPaM& rPam, SwMoveFnCollection const & fnMove) -> bool;
+SW_DLLPUBLIC bool GoInDoc( SwPaM&, SwMoveFnCollection const &);
+SW_DLLPUBLIC bool GoInSection( SwPaM&, SwMoveFnCollection const &);
+SW_DLLPUBLIC bool GoInNode( SwPaM&, SwMoveFnCollection const &);
+SW_DLLPUBLIC bool GoInContent( SwPaM&, SwMoveFnCollection const &);
+SW_DLLPUBLIC bool GoInContentCells( SwPaM&, SwMoveFnCollection const &);
+SW_DLLPUBLIC bool GoInContentSkipHidden( SwPaM&, SwMoveFnCollection const &);
+SW_DLLPUBLIC bool GoInContentCellsSkipHidden( SwPaM&, SwMoveFnCollection const &);
/// PaM is Point and Mark: a selection of the document model.
class SW_DLLPUBLIC SwPaM : public sw::Ring<SwPaM>
@@ -163,7 +162,7 @@ class SW_DLLPUBLIC SwPaM : public sw::Ring<SwPaM>
SwPosition * m_pMark; ///< points at either m_Bound1 or m_Bound2
bool m_bIsInFrontOfLabel;
- SwPaM* MakeRegion( SwMoveFn fnMove, const SwPaM * pOrigRg );
+ SwPaM* MakeRegion( SwMoveFnCollection const & fnMove, const SwPaM * pOrigRg );
SwPaM(SwPaM const& rPaM) = delete;
@@ -189,27 +188,27 @@ public:
SwPaM& operator=( const SwPaM & );
/// Movement of cursor.
- bool Move( SwMoveFn fnMove = fnMoveForward,
+ bool Move( SwMoveFnCollection const & fnMove = fnMoveForward,
SwGoInDoc fnGo = GoInContent );
/// Search.
bool Find( const css::util::SearchOptions2& rSearchOpt,
bool bSearchInNotes,
utl::TextSearch& rSText,
- SwMoveFn fnMove = fnMoveForward,
+ SwMoveFnCollection const & fnMove = fnMoveForward,
const SwPaM *pPam =nullptr, bool bInReadOnly = false);
bool Find( const SwFormat& rFormat,
- SwMoveFn fnMove = fnMoveForward,
+ SwMoveFnCollection const & fnMove = fnMoveForward,
const SwPaM *pPam =nullptr, bool bInReadOnly = false);
bool Find( const SfxPoolItem& rAttr, bool bValue,
- SwMoveFn fnMove = fnMoveForward,
+ SwMoveFnCollection const & fnMove = fnMoveForward,
const SwPaM *pPam =nullptr, bool bInReadOnly = false );
bool Find( const SfxItemSet& rAttr, bool bNoColls,
- SwMoveFn fnMove,
+ SwMoveFnCollection const & fnMove,
const SwPaM *pPam, bool bInReadOnly, bool bMoveFirst );
bool DoSearch( const css::util::SearchOptions2& rSearchOpt, utl::TextSearch& rSText,
- SwMoveFn fnMove, bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd,
+ SwMoveFnCollection const & fnMove, bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd,
sal_Int32 &nStart, sal_Int32 &nEnd, sal_Int32 nTextLen, SwNode* pNode, SwPaM* pPam);
inline bool IsInFrontOfLabel() const { return m_bIsInFrontOfLabel; }