summaryrefslogtreecommitdiff
path: root/sc/source/ui/cctrl/dpcontrol.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/cctrl/dpcontrol.cxx')
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx22
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);