diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-13 16:26:39 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-16 09:10:17 +0200 |
commit | 1315beb5683a73afbd7b7aec2a9823f96ce8b095 (patch) | |
tree | 6957abe4859a4e807282dcd63606891cfe62ca6e | |
parent | 850d0974be3612ee320e9a97f8dbfb20f892c6da (diff) |
sal_uInt8 to bool, use a cleaner predicate/setter interface
Change-Id: Ida136f1113b9e1df35559715b74573dabec6ac7d
-rw-r--r-- | vcl/source/edit/textdat2.hxx | 10 | ||||
-rw-r--r-- | vcl/source/edit/texteng.cxx | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx index eba87be28199..3d13718c5d14 100644 --- a/vcl/source/edit/textdat2.hxx +++ b/vcl/source/edit/textdat2.hxx @@ -50,13 +50,13 @@ private: sal_uInt16 nLen; long nWidth; sal_uInt8 nKind; - sal_uInt8 nRightToLeft; + bool bRightToLeft; TETextPortion() : nLen {0} , nWidth {-1} , nKind {PORTIONKIND_TEXT} - , nRightToLeft {0} + , bRightToLeft {false} {} public: @@ -64,14 +64,14 @@ public: : nLen {nL} , nWidth {-1} , nKind {PORTIONKIND_TEXT} - , nRightToLeft {0} + , bRightToLeft {false} {} sal_uInt16& GetLen() { return nLen; } long& GetWidth() { return nWidth; } sal_uInt8& GetKind() { return nKind; } - sal_uInt8& GetRightToLeft() { return nRightToLeft; } - bool IsRightToLeft() const { return (nRightToLeft&1); } + void SetRightToLeft(bool b) { bRightToLeft = b; } + bool IsRightToLeft() const { return bRightToLeft; } bool HasValidSize() const { return nWidth != (-1); } }; diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 794cea47bfc4..e8fb5b9e430e 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2266,7 +2266,7 @@ bool TextEngine::CreateLines( sal_uLong nPara ) pPortion->GetWidth() = (long)CalcTextWidth( nPara, nTmpPos, pPortion->GetLen() ); nTmpWidth += pPortion->GetWidth(); - pPortion->GetRightToLeft() = ImpGetRightToLeft( nPara, nTmpPos+1 ); + pPortion->SetRightToLeft( ImpGetRightToLeft( nPara, nTmpPos+1 ) ); pPortion->GetKind() = PORTIONKIND_TEXT; } @@ -2977,14 +2977,14 @@ long TextEngine::ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uIn TETextPortion* pDestPortion = pParaPortion->GetTextPortions()[ nTextPortion ]; if ( pDestPortion->GetKind() != PORTIONKIND_TAB ) { - if ( !IsRightToLeft() && pDestPortion->GetRightToLeft() ) + if ( !IsRightToLeft() && pDestPortion->IsRightToLeft() ) { // Portions behind must be added, visual before this portion sal_uInt16 nTmpPortion = nTextPortion+1; while ( nTmpPortion <= pLine->GetEndPortion() ) { TETextPortion* pNextTextPortion = pParaPortion->GetTextPortions()[ nTmpPortion ]; - if ( pNextTextPortion->GetRightToLeft() && ( pNextTextPortion->GetKind() != PORTIONKIND_TAB ) ) + if ( pNextTextPortion->IsRightToLeft() && ( pNextTextPortion->GetKind() != PORTIONKIND_TAB ) ) nX += pNextTextPortion->GetWidth(); else break; @@ -2996,7 +2996,7 @@ long TextEngine::ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uIn { --nTmpPortion; TETextPortion* pPrevTextPortion = pParaPortion->GetTextPortions()[ nTmpPortion ]; - if ( pPrevTextPortion->GetRightToLeft() && ( pPrevTextPortion->GetKind() != PORTIONKIND_TAB ) ) + if ( pPrevTextPortion->IsRightToLeft() && ( pPrevTextPortion->GetKind() != PORTIONKIND_TAB ) ) nX -= pPrevTextPortion->GetWidth(); else break; |