diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-12 17:52:36 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-19 10:18:32 +0200 |
commit | ae2232366f00e08c1855667cfaf068269ac9af2f (patch) | |
tree | a77bd8fb1f7f475ddb2597c576958407083c3972 /sw/inc | |
parent | b6db9f2755b5d64028daa29e1c531a2ecbd2c587 (diff) |
sw_redlinehide_2: view cursor movement, Word/Sentence functions
E.g. Ctrl+Left/Right, Ctrl+Shift+Del/Backspace, double-click to select
word...
These are all implemented in SwCursor, so they need a layout passed to
them from the SwViewShell.
There was a bug in the while loop in SwCursor::GoSentence() case
NEXT_SENT that triggered assert in the mapping code when the
endOfSentence() returned the length of the SwTextNode but then it was
incremented once more.
Change-Id: Ic3866860a8c07774dce35952271c207eb6e7d182
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/crsrsh.hxx | 12 | ||||
-rw-r--r-- | sw/inc/swcrsr.hxx | 30 |
2 files changed, 21 insertions, 21 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index f975533ac6e9..8b736656dec9 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -250,8 +250,18 @@ private: SAL_DLLPRIVATE bool isInHiddenTextFrame(SwShellCursor* pShellCursor); -typedef bool (SwCursor:: *FNCursor)(); + SAL_DLLPRIVATE bool GoStartWordImpl(); + SAL_DLLPRIVATE bool GoEndWordImpl(); + SAL_DLLPRIVATE bool GoNextWordImpl(); + SAL_DLLPRIVATE bool GoPrevWordImpl(); + SAL_DLLPRIVATE bool GoNextSentenceImpl(); + SAL_DLLPRIVATE bool GoEndSentenceImpl(); + SAL_DLLPRIVATE bool GoStartSentenceImpl(); + + typedef bool (SwCursor::*FNCursor)(); + typedef bool (SwCursorShell::*FNCursorShell)(); SAL_DLLPRIVATE bool CallCursorFN( FNCursor ); + SAL_DLLPRIVATE bool CallCursorShellFN( FNCursorShell ); SAL_DLLPRIVATE const SwRangeRedline* GotoRedline_( SwRedlineTable::size_type nArrPos, bool bSelect ); diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 9ec86d6f5f77..6eccacf8f1e3 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -131,25 +131,18 @@ public: const SfxItemSet* rReplSet = nullptr ); // UI versions - bool IsStartWord( sal_Int16 nWordType ) const; - bool IsEndWord( sal_Int16 nWordType ) const; - bool IsInWord( sal_Int16 nWordType ) const; - bool IsStartEndSentence( bool bEnd ) const; - bool GoStartWord(); - bool GoEndWord(); - bool GoNextWord(); - bool GoPrevWord(); + bool IsStartEndSentence(bool bEnd, SwRootFrame const* pLayout) const; bool SelectWord( SwViewShell const * pViewShell, const Point* pPt ); // API versions of above functions (will be used with a different // WordType for the break iterator) - bool IsStartWordWT( sal_Int16 nWordType ) const; - bool IsEndWordWT( sal_Int16 nWordType ) const; - bool IsInWordWT( sal_Int16 nWordType ) const; - bool GoStartWordWT( sal_Int16 nWordType ); - bool GoEndWordWT( sal_Int16 nWordType ); - bool GoNextWordWT( sal_Int16 nWordType ); - bool GoPrevWordWT( sal_Int16 nWordType ); + bool IsStartWordWT(sal_Int16 nWordType, SwRootFrame const* pLayout = nullptr) const; + bool IsEndWordWT(sal_Int16 nWordType, SwRootFrame const* pLayout = nullptr) const; + bool IsInWordWT(sal_Int16 nWordType, SwRootFrame const* pLayout = nullptr) const; + bool GoStartWordWT(sal_Int16 nWordType, SwRootFrame const* pLayout = nullptr); + bool GoEndWordWT(sal_Int16 nWordType, SwRootFrame const* pLayout = nullptr); + bool GoNextWordWT(sal_Int16 nWordType, SwRootFrame const* pLayout = nullptr); + bool GoPrevWordWT(sal_Int16 nWordType, SwRootFrame const* pLayout = nullptr); bool SelectWordWT( SwViewShell const * pViewShell, sal_Int16 nWordType, const Point* pPt ); enum SentenceMoveType @@ -159,11 +152,8 @@ public: START_SENT, END_SENT }; - bool GoSentence(SentenceMoveType eMoveType); - bool GoNextSentence(){return GoSentence(NEXT_SENT);} - bool GoEndSentence(){return GoSentence(END_SENT);} - bool GoStartSentence(){return GoSentence(START_SENT);} - bool ExpandToSentenceBorders(); + bool GoSentence(SentenceMoveType eMoveType, SwRootFrame const*pLayout = nullptr); + bool ExpandToSentenceBorders(SwRootFrame const* pLayout); virtual bool LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, bool bAllowVisual, bool bSkipHidden, bool bInsertCursor, |