diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2011-12-14 16:31:51 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2011-12-14 16:34:23 +0100 |
commit | 829c5338b7102e7add7a080c50b938100a38b2e5 (patch) | |
tree | a24cf0c9cbde48cfb5f560093a092582aa0cbe77 /sw | |
parent | 248bfdfa0f9e380098c111dff5e98e73b1521233 (diff) |
Header/Footer: RTL display fixes (fdo#43793)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/docvw/HeaderFooterWin.cxx | 14 |
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( ) ) |