diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-04-20 07:56:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-04-20 07:56:54 +0200 |
commit | 6b7594a84eaff5594d019ecc0ad324ebaa6f760d (patch) | |
tree | 6586701678b5adaf6b1495acd93259ad8a652e34 /editeng | |
parent | 97725c3a1fa020fb3562e5fbcb1ac348c2138434 (diff) |
Use IsRightToLeft()
...instead of computing this from GetRightToLeftLevel()
Change-Id: If0068c8aae581b6f097ba3897b4a3031db8d9afd
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 3 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index f1c8d40e5bc6..d22c03c86214 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -962,8 +962,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) { sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, (nShowCursorFlags & GETCRSR_PREFERPORTIONSTART) != 0 ); const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; - sal_uInt16 nRTLLevel = rTextPortion.GetRightToLeftLevel(); - if ( nRTLLevel%2 ) + if (rTextPortion.IsRightToLeft()) nCursorDir = CursorDirection::RTL; else nCursorDir = CursorDirection::LTR; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 9addb3db6b9d..6d19ff01ce87 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -949,8 +949,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& sal_Int32 nTmp; sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTmp, true ); const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; - sal_Int32 nRTLLevel = rTextPortion.GetRightToLeftLevel(); - bool bPortionRTL = (nRTLLevel%2) != 0; + bool bPortionRTL = rTextPortion.IsRightToLeft(); if ( bStart ) { @@ -1092,7 +1091,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM sal_Int32 nPortionStart; sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, bBeforePortion ); const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; - bool bRTLPortion = (rTextPortion.GetRightToLeftLevel() % 2) != 0; + bool bRTLPortion = rTextPortion.IsRightToLeft(); // -1: We are 'behind' the character long nVisPos = (long)ubidi_getVisualIndex( pBidi, bWasBehind ? nPosInLine-1 : nPosInLine, &nError ); @@ -1119,9 +1118,9 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM // sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, !bRTLPortion ); sal_Int32 _nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), _nPortionStart, true ); const TextPortion& _rTextPortion = pParaPortion->GetTextPortions()[_nTextPortion]; - if ( bVisualToLeft && !bRTLPortion && ( _rTextPortion.GetRightToLeftLevel() % 2 ) ) + if ( bVisualToLeft && !bRTLPortion && _rTextPortion.IsRightToLeft() ) aPaM.SetIndex( aPaM.GetIndex()+1 ); - else if ( !bVisualToLeft && bRTLPortion && ( bWasBehind || !(_rTextPortion.GetRightToLeftLevel() % 2 )) ) + else if ( !bVisualToLeft && bRTLPortion && ( bWasBehind || !_rTextPortion.IsRightToLeft() ) ) aPaM.SetIndex( aPaM.GetIndex()+1 ); pEditView->pImpEditView->SetCursorBidiLevel( _nPortionStart ); |