summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-04-15 00:18:11 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-04-15 00:23:41 +0200
commitc3591519e25204c0ceaca1aa90942273374f8640 (patch)
tree0785b2e3ed2035f6c03fc74dc478e03803c89d31
parent71fa72c6d03852c563206baaa8bd3d303da3e6b0 (diff)
Fix vertical text and bitmap bullet rendering feature/table_rotated_text
Change-Id: I881fce0511c81b164516d68f72c7e750687d4e0e
-rw-r--r--editeng/source/outliner/outlin2.cxx5
-rw-r--r--editeng/source/outliner/outliner.cxx29
-rw-r--r--include/editeng/outliner.hxx1
3 files changed, 29 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)
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 5d2ce0044517..e8fdb13b6920 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -686,6 +686,7 @@ public:
void SetVertical( bool bVertical, bool bTopToBottom = true);
bool IsVertical() const;
+ bool IsTopToBottom() const;
void SetFixedCellHeight( bool bUseFixedCellHeight );