summaryrefslogtreecommitdiff
path: root/sw/source/ui/docvw/HeaderFooterWin.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-15 12:02:29 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2011-12-16 17:36:01 +0100
commit588857a86bcbc85e21b70ca95a9ab0c0b782a996 (patch)
tree179c2c1d1c22761513a6cf932ce43001adb8f4f0 /sw/source/ui/docvw/HeaderFooterWin.cxx
parent44ec593f74ed215fa0795b2ea1cd97951158b726 (diff)
fdo#43790: RTL PopupMenu position fixes
Fixed the Writer PageBreak and Header/Footer indicator position. It also fixed the popup menu position in RTL UI for all PopupButton instances.
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index d3ce419bc65b..64e75e456d41 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -223,6 +223,11 @@ void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long nXLineE
Point aBoxPos( aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
aOffset.Y() - nYFooterOff );
+ if ( Application::GetSettings().GetLayoutRTL() )
+ {
+ aBoxPos.setX( aOffset.X() + BOX_DISTANCE );
+ }
+
// Set the position & Size of the window
SetPosSizePixel( aBoxPos, aBoxSize );
@@ -284,8 +289,6 @@ 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(
@@ -296,11 +299,7 @@ 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( nTextOffsetX, nTextOffsetY );
+ Point aTextPos( TEXT_PADDING, nTextOffsetY );
basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix(
aFontSize.getX(), aFontSize.getY(),
@@ -317,11 +316,8 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
// Create the 'plus' or 'arrow' primitive if not readonly
if ( !m_bReadonly )
{
- double aSignPosX = aRect.Right() - BUTTON_WIDTH;
- if ( bRtl )
- aSignPosX = aRect.Left();
- B2DRectangle aSignArea( B2DPoint( aSignPosX, 0.0 ),
- B2DSize( aSignPosX + BUTTON_WIDTH, aRect.getHeight() ) );
+ B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
+ B2DSize( aRect.Right(), aRect.getHeight() ) );
B2DPolygon aSign;
if ( IsEmptyHeaderFooter( ) )