summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-01-29 12:44:30 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-05-28 09:19:10 +0100
commit042183f875962bb588ac259529ed8e93a7008c89 (patch)
tree82a4c69e845b1d144d7b3f6fe82119e6ffd7b114 /sd
parentaa8c235386dd4075cd25ec38f7a09eb1e7877b32 (diff)
lok: preserve mouse event logic position and use in calc
When clicking in online Calc any of the charts, shapes (and other objects), sometimes the cell underneath is selected instead. The problem is that the object is not correctly recognised to be hit. From lok we get the mouse event position in logic coordinates, which we usually can just use in writer and impress. In calc however we need the coordinates in pixels, so we transform them before sending the mouse event to calc. Still calc also uses common SdrObjects (chart, shapes,...), which operate in logic coordinates. So in case of SdrObject we need to convert the coordniates back from pixel to logic again, which causes problems because conversion doesn't have access to the displaying conditions on an stateless online client. OTOH we already had the correct logic coordinates, and we can just send them along. This is what this change does. It adds an optional maLogicPosition to MouseEvent, which is filled with logic position if those is known. Change-Id: I26f6466085baf613850b5861e368f22cad7c1d26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87681 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 26263aa21cc3..7b8e09adf038 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2510,10 +2510,9 @@ void SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount, i
}
const Point aPos(Point(convertTwipToMm100(nX), convertTwipToMm100(nY)));
- SfxLokHelper::postMouseEventAsync(pViewShell->GetActiveWindow(), nType,
- aPos, nCount,
- MouseEventModifiers::SIMPLECLICK,
+ LokMouseEventData aMouseEventData(nType, aPos, nCount, MouseEventModifiers::SIMPLECLICK,
nButtons, nModifier);
+ SfxLokHelper::postMouseEventAsync(pViewShell->GetActiveWindow(), aMouseEventData);
}
void SdXImpressDocument::setTextSelection(int nType, int nX, int nY)