summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/text/porlin.cxx4
-rw-r--r--sw/source/core/text/porrst.cxx17
2 files changed, 18 insertions, 3 deletions
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 0c7ff0252075..b5adccb07fba 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -114,12 +114,12 @@ void SwLinePortion::PrePaint( const SwTextPaintInfo& rInf,
break;
case 900:
nPos = sal_uInt16( rInf.Y() );
- nPos -= nLastWidth + nHalfView;
+ nPos -= nLastWidth - nHalfView;
aInf.Y( nPos );
break;
case 1800:
nPos = sal_uInt16( rInf.X() );
- nPos -= nLastWidth + nHalfView;
+ nPos -= nLastWidth - nHalfView;
aInf.X( nPos );
break;
case 2700:
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index e4c56b98669f..686959609cd8 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -522,7 +522,22 @@ void SwControlCharPortion::Paint( const SwTextPaintInfo &rInf ) const
Point aOldPos = rInf.GetPos();
Point aNewPos( aOldPos );
- aNewPos.setX( aNewPos.X() + ( Width() / 2 ) - mnHalfCharWidth );
+ auto const deltaX((Width() / 2) - mnHalfCharWidth);
+ switch (rInf.GetFont()->GetOrientation(rInf.GetTextFrame()->IsVertical()))
+ {
+ case 0:
+ aNewPos.AdjustX(deltaX);
+ break;
+ case 900:
+ aNewPos.AdjustY(-deltaX);
+ break;
+ case 2700:
+ aNewPos.AdjustY(deltaX);
+ break;
+ default:
+ assert(false);
+ break;
+ }
const_cast< SwTextPaintInfo& >( rInf ).SetPos( aNewPos );
rInf.DrawText( aOutString, *this );