diff options
author | Niklas Nebel <nn@openoffice.org> | 2010-10-06 17:08:15 +0200 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2010-10-06 17:08:15 +0200 |
commit | 6d9b321745e617daed8a407b97ee4c1c4a24eaa6 (patch) | |
tree | 4cf6c652fa71ad0b458fe862b2828015d0b59cdb /sc/source/ui/cctrl/dpcontrol.cxx | |
parent | c548b0b0b38ad2b1a7184a4ffc97ca26958b0389 (diff) |
ooo33gsl10: #i114944# handle AutoFilter button position on RTL sheets
Diffstat (limited to 'sc/source/ui/cctrl/dpcontrol.cxx')
-rw-r--r-- | sc/source/ui/cctrl/dpcontrol.cxx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 82c276d98f2c..b90a51ed6bee 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -66,7 +66,8 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt mbBaseButton(true), mbPopupButton(false), mbHasHiddenMember(false), - mbPopupPressed(false) + mbPopupPressed(false), + mbPopupLeft(false) { if (pZoomX) maZoomX = *pZoomX; @@ -88,10 +89,15 @@ void ScDPFieldButton::setText(const OUString& rText) maText = rText; } -void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize) +void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL) { maPos = rPos; maSize = rSize; + if (bLayoutRTL) + { + // rPos is the logical-left position, adjust maPos to visual-left (inside the cell border) + maPos.X() -= maSize.Width() - 1; + } } void ScDPFieldButton::setDrawBaseButton(bool b) @@ -114,6 +120,11 @@ void ScDPFieldButton::setPopupPressed(bool b) mbPopupPressed = b; } +void ScDPFieldButton::setPopupLeft(bool b) +{ + mbPopupLeft = b; +} + void ScDPFieldButton::draw() { const long nMargin = 2; @@ -179,7 +190,12 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const if (nH > 18) nH = 18; - rPos.setX(maPos.getX() + maSize.getWidth() - nW); + // #i114944# AutoFilter button is left-aligned in RTL. + // DataPilot button is always right-aligned for now, so text output isn't affected. + if (mbPopupLeft) + rPos.setX(maPos.getX()); + else + rPos.setX(maPos.getX() + maSize.getWidth() - nW); rPos.setY(maPos.getY() + maSize.getHeight() - nH); rSize.setWidth(nW); rSize.setHeight(nH); |