summaryrefslogtreecommitdiff
path: root/sw/source/ui/docvw/HeaderFooterWin.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-14 16:31:51 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-14 16:32:09 +0100
commite355b05c90d5182ecf97fd5e1f762b5460b7d45c (patch)
tree432b751dd6e2226df715f513860f447e8683dfbc /sw/source/ui/docvw/HeaderFooterWin.cxx
parent003023f4dfa5467feab0a43ba31c73717547f44c (diff)
Header/Footer: RTL display fixes (fdo#43793)
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index d8f6395c52be..d3ce419bc65b 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -284,6 +284,8 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
aSeq[1] = Primitive2DReference( new PolygonHairlinePrimitive2D(
aPolygon, aLineColor ) );
+ bool bRtl = Application::GetSettings().GetLayoutRTL();
+
// Create the text primitive
B2DVector aFontSize;
FontAttribute aFontAttr = getFontAttributeFromVclFont(
@@ -294,8 +296,11 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
FontMetric aFontMetric = GetFontMetric( GetFont() );
double nTextOffsetY = aFontMetric.GetHeight() - aFontMetric.GetDescent() + TEXT_PADDING;
+ double nTextOffsetX = TEXT_PADDING;
+ if ( bRtl )
+ nTextOffsetX = aRect.GetWidth( ) - aTextRect.GetWidth() - TEXT_PADDING;
- Point aTextPos( TEXT_PADDING, nTextOffsetY );
+ Point aTextPos( nTextOffsetX, nTextOffsetY );
basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix(
aFontSize.getX(), aFontSize.getY(),
@@ -312,8 +317,11 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
// Create the 'plus' or 'arrow' primitive if not readonly
if ( !m_bReadonly )
{
- B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
- B2DSize( aRect.Right(), aRect.getHeight() ) );
+ double aSignPosX = aRect.Right() - BUTTON_WIDTH;
+ if ( bRtl )
+ aSignPosX = aRect.Left();
+ B2DRectangle aSignArea( B2DPoint( aSignPosX, 0.0 ),
+ B2DSize( aSignPosX + BUTTON_WIDTH, aRect.getHeight() ) );
B2DPolygon aSign;
if ( IsEmptyHeaderFooter( ) )