editeng/source/editeng/editdoc.hxx  |   14 +++++++-------
 editeng/source/editeng/impedit.cxx  |    2 +-
 editeng/source/editeng/impedit2.cxx |   20 ++++++++++----------
 editeng/source/editeng/impedit3.cxx |    6 +++---
 4 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit 5be5f00fe16b0e255b31fbaba5f119773d1cd071
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Tue Apr 19 18:23:49 2016 +0200

    So this is apparently about right-to-left levels, not a boolean flag
    
    Although the cases where GetRightToLeftLevel() is contextually converted to 
bool
    look fishy, and might have been intended to use IsRightToLeft() instead?
    
    Change-Id: I741b90cb6f1ccdac0886c451d05f4cfac79dbd5f

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index a18a682..d052551 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -377,7 +377,7 @@ private:
     sal_Int32           nLen;
     Size                aOutSz;
     PortionKind         nKind;
-    sal_uInt8           nRightToLeft;
+    sal_uInt8           nRightToLeftLevel;
     sal_Unicode         nExtraValue;
 
 
@@ -386,7 +386,7 @@ private:
                 , nLen( 0 )
                 , aOutSz()
                 , nKind( PortionKind::TEXT )
-                , nRightToLeft( sal_False )
+                , nRightToLeftLevel( 0 )
                 , nExtraValue( 0 )
                 {
                 }
@@ -397,7 +397,7 @@ public:
                 , nLen( nL )
                 , aOutSz( -1, -1 )
                 , nKind( PortionKind::TEXT )
-                , nRightToLeft( sal_False )
+                , nRightToLeftLevel( 0 )
                 , nExtraValue( 0 )
                 {
                 }
@@ -407,7 +407,7 @@ public:
                 , nLen( r.nLen )
                 , aOutSz( r.aOutSz )
                 , nKind( r.nKind )
-                , nRightToLeft( r.nRightToLeft )
+                , nRightToLeftLevel( r.nRightToLeftLevel )
                 , nExtraValue( r.nExtraValue )
                 {
                 }
@@ -422,9 +422,9 @@ public:
     PortionKind&   GetKind()                   { return nKind; }
     PortionKind    GetKind() const             { return nKind; }
 
-    void           SetRightToLeft( sal_uInt8 b )    { nRightToLeft = b; }
-    sal_uInt8      GetRightToLeft() const      { return nRightToLeft; }
-    bool           IsRightToLeft() const       { return (nRightToLeft&1); }
+    void           SetRightToLeftLevel( sal_uInt8 n ) { nRightToLeftLevel = n; 
}
+    sal_uInt8      GetRightToLeftLevel() const { return nRightToLeftLevel; }
+    bool           IsRightToLeft() const       { return (nRightToLeftLevel&1); 
}
 
     sal_Unicode    GetExtraValue() const       { return nExtraValue; }
     void           SetExtraValue( sal_Unicode n )  { nExtraValue = n; }
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 6b1bd6f..f1c8d40 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -962,7 +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.GetRightToLeft();
+            sal_uInt16 nRTLLevel = rTextPortion.GetRightToLeftLevel();
             if ( nRTLLevel%2 )
                 nCursorDir = CursorDirection::RTL;
             else
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index b934c30..9addb3d 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -949,7 +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.GetRightToLeft();
+        sal_Int32 nRTLLevel = rTextPortion.GetRightToLeftLevel();
         bool bPortionRTL = (nRTLLevel%2) != 0;
 
         if ( bStart )
@@ -1015,7 +1015,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* 
pEditView, const EditPaM
         const TextPortion& rTextPortion = 
pParaPortion->GetTextPortions()[nTextPortion];
 
         bool bPortionBoundary = ( aPaM.GetIndex() == nPortionStart ) || ( 
aPaM.GetIndex() == (nPortionStart+rTextPortion.GetLen()) );
-        sal_uInt16 nRTLLevel = rTextPortion.GetRightToLeft();
+        sal_uInt16 nRTLLevel = rTextPortion.GetRightToLeftLevel();
 
         // Portion boundary doesn't matter if both have same RTL level
         sal_Int32 nRTLLevelNextPortion = -1;
@@ -1024,7 +1024,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* 
pEditView, const EditPaM
             sal_Int32 nTmp;
             sal_Int32 nNextTextPortion = 
pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex()+1, nTmp, 
!bLogicalBackward );
             const TextPortion& rNextTextPortion = 
pParaPortion->GetTextPortions()[nNextTextPortion];
-            nRTLLevelNextPortion = rNextTextPortion.GetRightToLeft();
+            nRTLLevelNextPortion = rNextTextPortion.GetRightToLeftLevel();
         }
 
         if ( !bPortionBoundary || ( nRTLLevel == nRTLLevelNextPortion ) )
@@ -1092,7 +1092,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.GetRightToLeft() % 2) != 0;
+            bool bRTLPortion = (rTextPortion.GetRightToLeftLevel() % 2) != 0;
 
             // -1: We are 'behind' the character
             long nVisPos = (long)ubidi_getVisualIndex( pBidi, bWasBehind ? 
nPosInLine-1 : nPosInLine, &nError );
@@ -1119,9 +1119,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.GetRightToLeft() % 2 ) )
+                if ( bVisualToLeft && !bRTLPortion && ( 
_rTextPortion.GetRightToLeftLevel() % 2 ) )
                     aPaM.SetIndex( aPaM.GetIndex()+1 );
-                else if ( !bVisualToLeft && bRTLPortion && ( bWasBehind || 
!(_rTextPortion.GetRightToLeft() % 2 )) )
+                else if ( !bVisualToLeft && bRTLPortion && ( bWasBehind || 
!(_rTextPortion.GetRightToLeftLevel() % 2 )) )
                     aPaM.SetIndex( aPaM.GetIndex()+1 );
 
                 pEditView->pImpEditView->SetCursorBidiLevel( _nPortionStart );
@@ -1963,7 +1963,7 @@ bool ImpEditEngine::HasDifferentRTLLevels( const 
ContentNode* pNode )
     for ( sal_Int32 n = 0; n < 
(sal_Int32)pParaPortion->GetTextPortions().Count(); n++ )
     {
         const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[n];
-        if ( rTextPortion.GetRightToLeft() != nRTLLevel )
+        if ( rTextPortion.GetRightToLeftLevel() != nRTLLevel )
         {
             bHasDifferentRTLLevels = true;
             break;
@@ -3815,14 +3815,14 @@ long ImpEditEngine::GetPortionXOffset(
     const TextPortion& rDestPortion = 
pParaPortion->GetTextPortions()[nTextPortion];
     if ( rDestPortion.GetKind() != PortionKind::TAB )
     {
-        if ( !bR2LPara && rDestPortion.GetRightToLeft() )
+        if ( !bR2LPara && rDestPortion.GetRightToLeftLevel() )
         {
             // Portions behind must be added, visual before this portion
             sal_Int32 nTmpPortion = nTextPortion+1;
             while ( nTmpPortion <= pLine->GetEndPortion() )
             {
                 const TextPortion& rNextTextPortion = 
pParaPortion->GetTextPortions()[nTmpPortion];
-                if ( rNextTextPortion.GetRightToLeft() && ( 
rNextTextPortion.GetKind() != PortionKind::TAB ) )
+                if ( rNextTextPortion.GetRightToLeftLevel() && ( 
rNextTextPortion.GetKind() != PortionKind::TAB ) )
                     nX += rNextTextPortion.GetSize().Width();
                 else
                     break;
@@ -3834,7 +3834,7 @@ long ImpEditEngine::GetPortionXOffset(
             {
                 --nTmpPortion;
                 const TextPortion& rPrevTextPortion = 
pParaPortion->GetTextPortions()[nTmpPortion];
-                if ( rPrevTextPortion.GetRightToLeft() && ( 
rPrevTextPortion.GetKind() != PortionKind::TAB ) )
+                if ( rPrevTextPortion.GetRightToLeftLevel() && ( 
rPrevTextPortion.GetKind() != PortionKind::TAB ) )
                     nX -= rPrevTextPortion.GetSize().Width();
                 else
                     break;
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 7a2b9ac..d9ad302 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1076,7 +1076,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
                 aTmpFont.SetPhysFont( GetRefDevice() );
                 ImplInitDigitMode(GetRefDevice(), aTmpFont.GetLanguage());
 
-                pPortion->SetRightToLeft( GetRightToLeft( nPara, nTmpPos+1 ) );
+                pPortion->SetRightToLeftLevel( GetRightToLeft( nPara, 
nTmpPos+1 ) );
 
                 if ( bCalcCharPositions || !pPortion->HasValidSize() )
                 {
@@ -3341,7 +3341,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, 
Rectangle aClipRect, Point aSt
 
                                     // StripPortions() data callback
                                     GetEditEnginePtr()->DrawingText( aOutPos, 
aText, nTextStart, nTextLen, pDXArray,
-                                        aTmpFont, n, 
rTextPortion.GetRightToLeft(),
+                                        aTmpFont, n, 
rTextPortion.GetRightToLeftLevel(),
                                         aWrongSpellVector.size() ? 
&aWrongSpellVector : nullptr,
                                         pFieldData,
                                         bEndOfLine, bEndOfParagraph, // 
support for EOL/EOP TEXT comments
@@ -3571,7 +3571,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, 
Rectangle aClipRect, Point aSt
                                         GetEditEnginePtr()->DrawingTab( 
aTmpPos,
                                             rTextPortion.GetSize().Width(),
                                             
OUString(rTextPortion.GetExtraValue()),
-                                            aTmpFont, n, 
rTextPortion.GetRightToLeft(),
+                                            aTmpFont, n, 
rTextPortion.GetRightToLeftLevel(),
                                             bEndOfLine, bEndOfParagraph,
                                             aOverlineColor, aTextLineColor);
                                     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to