summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2022-01-04 14:20:41 +0530
committerAndras Timar <andras.timar@collabora.com>2022-01-11 11:18:09 +0100
commit0f2208a43861ebe94c4a2482a0cf7e5c63bb186e (patch)
tree37870dc952f1c7ee3205df8ee68619afa4f155c3
parentlokCalcRTL: fix editing of shape text (diff)
downloadcore-0f2208a43861ebe94c4a2482a0cf7e5c63bb186e.tar.gz
core-0f2208a43861ebe94c4a2482a0cf7e5c63bb186e.zip
lokCalcRTL: negate mouse event X for chart and controls
Change-Id: I389047140d1a3d2c67a861a3e20f799206d937b6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 9f89e3be6af8..3af00c03a404 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -735,8 +735,14 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButt
// check if user hit a chart which is being edited by him
ScTabViewShell * pTabViewShell = pViewData->GetViewShell();
+ SCTAB nTab = pViewData->GetTabNo();
LokChartHelper aChartHelper(pTabViewShell);
- if (aChartHelper.postMouseEvent(nType, nX, nY,
+ const ScDocument& rDoc = pDocShell->GetDocument();
+ // In LOK RTL mode draw/svx operates in negative X coordinates
+ // But the coordinates from client is always positive, so negate nX for draw.
+ bool bDrawNegativeX = rDoc.IsNegativePage(nTab);
+ int nDrawX = bDrawNegativeX ? -nX : nX;
+ if (aChartHelper.postMouseEvent(nType, nDrawX, nY,
nCount, nButtons, nModifier,
pViewData->GetPPTX(), pViewData->GetPPTY()))
{
@@ -744,21 +750,23 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButt
}
Point aPointTwip(nX, nY);
+ Point aPointTwipDraw(nDrawX, nY);
// check if the user hit a chart which is being edited by someone else
// and, if so, skip current mouse event
if (nType != LOK_MOUSEEVENT_MOUSEMOVE)
{
- if (LokChartHelper::HitAny(aPointTwip))
+ if (LokChartHelper::HitAny(aPointTwipDraw))
return;
}
// Check if a control is hit
Point aPointHMM = LokControlHandler::convertTwipToMm100(aPointTwip);
+ Point aPointHMMDraw(bDrawNegativeX ? -aPointHMM.X() : aPointHMM.X(), aPointHMM.Y());
ScDrawLayer* pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
- SdrPage* pPage = pDrawLayer->GetPage(sal_uInt16(pViewData->GetTabNo()));
+ SdrPage* pPage = pDrawLayer->GetPage(sal_uInt16(nTab));
SdrView* pDrawView = pViewData->GetViewShell()->GetScDrawView();
- if (LokControlHandler::postMouseEvent(pPage, pDrawView, *pGridWindow, nType, aPointHMM, nCount, nButtons, nModifier))
+ if (LokControlHandler::postMouseEvent(pPage, pDrawView, *pGridWindow, nType, aPointHMMDraw, nCount, nButtons, nModifier))
return;
if (!pGridWindow->HasChildPathFocus(true))