diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-04-15 00:18:11 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-04-15 15:40:56 +0200 |
commit | 15ac3f9f4dc65fc0c6020284064e3725956f5d0a (patch) | |
tree | 5e6c4bb8dea4491434671c4b53b364ed7be59cf4 /editeng | |
parent | 820e47fdecd47b171786d3aadef5cc77e93b795e (diff) |
Fix vertical text and bitmap bullet rendering
Change-Id: I881fce0511c81b164516d68f72c7e750687d4e0e
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/outliner/outlin2.cxx | 5 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 29 |
2 files changed, 28 insertions, 6 deletions
diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index 08495c39fa07..45efe99362ed 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -536,6 +536,11 @@ bool Outliner::IsVertical() const return pEditEngine->IsVertical(); } +bool Outliner::IsTopToBottom() const +{ + return pEditEngine->IsTopToBottom(); +} + void Outliner::SetFixedCellHeight( bool bUseFixedCellHeight ) { pEditEngine->SetFixedCellHeight( bUseFixedCellHeight ); diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 3f7914ff2ad2..6ffaf540edfe 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -861,7 +861,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const aBulletFont.SetFontSize( Size( 0, nScaledLineHeight ) ); bool bVertical = IsVertical(); aBulletFont.SetVertical( bVertical ); - aBulletFont.SetOrientation( bVertical ? 2700 : 0 ); + aBulletFont.SetOrientation( bVertical ? (IsTopToBottom() ? 2700 : 900) : 0 ); Color aColor( COL_AUTO ); if( !pEditEngine->IsFlatMode() && !( pEditEngine->GetControlWord() & EEControlBits::NOCOLORS ) ) @@ -890,6 +890,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos, if (bDrawBullet && ImplHasNumberFormat(nPara)) { bool bVertical = IsVertical(); + bool bTopToBottom = IsTopToBottom(); bool bRightToLeftPara = pEditEngine->IsRightToLeft( nPara ); @@ -927,9 +928,17 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos, } else { -// aTextPos.X() = rStartPos.X() - aBulletArea.Bottom(); - aTextPos.X() = rStartPos.X() - ( bSymbol ? aBulletArea.Bottom() : aParaInfos.nFirstLineMaxAscent ); - aTextPos.Y() = rStartPos.Y() + aBulletArea.Left(); + if (bTopToBottom) + { +// aTextPos.X() = rStartPos.X() - aBulletArea.Bottom(); + aTextPos.X() = rStartPos.X() - (bSymbol ? aBulletArea.Bottom() : aParaInfos.nFirstLineMaxAscent); + aTextPos.Y() = rStartPos.Y() + aBulletArea.Left(); + } + else + { + aTextPos.X() = rStartPos.X() + (bSymbol ? aBulletArea.Bottom() : aParaInfos.nFirstLineMaxAscent); + aTextPos.Y() = rStartPos.Y() + aBulletArea.Left(); + } } if ( nOrientation ) @@ -998,8 +1007,16 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos, } else { - aBulletPos.X() = rStartPos.X() - aBulletArea.Bottom(); - aBulletPos.Y() = rStartPos.Y() + aBulletArea.Left(); + if (bTopToBottom) + { + aBulletPos.X() = rStartPos.X() - aBulletArea.Bottom(); + aBulletPos.Y() = rStartPos.Y() + aBulletArea.Left(); + } + else + { + aBulletPos.X() = rStartPos.X() + aBulletArea.Top(); + aBulletPos.Y() = rStartPos.Y() - aBulletArea.Right(); + } } if(bStrippingPortions) |