summaryrefslogtreecommitdiff
path: root/sw/inc/swcrsr.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-07-26 18:19:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-26 22:42:16 +0200
commit4c38f51c727fac25fdeb15d78a24d9203fabac5c (patch)
tree025a161ba1511c93bdf357993742358d9a6e9226 /sw/inc/swcrsr.hxx
parentb13631c562e85a6567a600edc5bb1d93418e4f53 (diff)
convert CRSR_SKIP_* to typed enum
Change-Id: Ia5cb9915fc7ad3238f4386f5ed3e43efc4b74a32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137478 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/swcrsr.hxx')
-rw-r--r--sw/inc/swcrsr.hxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index f36e0167d5c3..c3d3f5d040e4 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -62,10 +62,10 @@ namespace o3tl {
// the same, but in complex text cell skip over ligatures and char skip
// into it.
// These defines exist only to cut off the dependencies to I18N project.
-const sal_uInt16 CRSR_SKIP_CHARS = 0;
-const sal_uInt16 CRSR_SKIP_CELLS = 1;
-const sal_uInt16 CRSR_SKIP_HIDDEN = 2;
-
+enum class SwCursorSkipMode { Chars = 0, Cells = 1, Hidden = 2 };
+namespace o3tl {
+ template<> struct typed_flags<SwCursorSkipMode> : is_typed_flags<SwCursorSkipMode, 0x3> {};
+}
class SW_DLLPUBLIC SwCursor : public SwPaM
{
@@ -160,7 +160,7 @@ public:
bool GoSentence(SentenceMoveType eMoveType, SwRootFrame const*pLayout = nullptr);
void ExpandToSentenceBorders(SwRootFrame const* pLayout);
- virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
+ virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode,
bool bAllowVisual, bool bSkipHidden, bool bInsertCursor,
SwRootFrame const* pLayout, bool isFieldNames);
bool UpDown(bool bUp, sal_uInt16 nCnt, Point const * pPt, tools::Long nUpDownX, SwRootFrame & rLayout);
@@ -169,8 +169,8 @@ public:
bool SttEndDoc( bool bSttDoc );
bool GoPrevNextCell( bool bNext, sal_uInt16 nCnt );
- bool Left( sal_uInt16 nCnt ) { return LeftRight(true, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); }
- bool Right( sal_uInt16 nCnt ) { return LeftRight(false, nCnt, CRSR_SKIP_CHARS, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); }
+ bool Left( sal_uInt16 nCnt ) { return LeftRight(true, nCnt, SwCursorSkipMode::Chars, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); }
+ bool Right( sal_uInt16 nCnt ) { return LeftRight(false, nCnt, SwCursorSkipMode::Chars, false/*bAllowVisual*/, false/*bSkipHidden*/, false, nullptr, false); }
bool GoNextCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( true, nCnt ); }
bool GoPrevCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( false, nCnt ); }
virtual bool GotoTable( const OUString& rName );
@@ -269,7 +269,7 @@ public:
SwTableCursor( SwTableCursor& );
virtual ~SwTableCursor() override;
- virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
+ virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode,
bool bAllowVisual, bool bSkipHidden, bool bInsertCursor,
SwRootFrame const*, bool) override;
virtual bool GotoTable( const OUString& rName ) override;