summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl/unomodel.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-16 17:40:27 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-16 17:08:08 +0100
commit2d4cde2f75d4aaa3a69fdd65ee7584eb15d20275 (patch)
tree974fcea75daed2a7fbf5a89d202b9de844c469e7 /sd/source/ui/unoidl/unomodel.cxx
parent6eb9529abef9d7588899f9b241f31baa0b2beee2 (diff)
lok: handle mouse/keyboard events in Math embedded in Impress/Draw
Since Impress/Draw use mm100, we need to convert object area that SfxInPlaceClient provides, which is in parent units, into twips. TODO: how would taking the units from object shell with Calc, given that it does not call SetMapUnit in ScDocShell ctor? Change-Id: I8de2088a3e0e7f9070d6c3c234b40038b6e00f15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142777 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd/source/ui/unoidl/unomodel.cxx')
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 2125fe109ed5..db972faeb633 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2429,16 +2429,16 @@ VclPtr<vcl::Window> SdXImpressDocument::getDocWindow()
{
SolarMutexGuard aGuard;
DrawViewShell* pViewShell = GetViewShell();
- VclPtr<vcl::Window> pWindow;
- if (pViewShell)
- pWindow = pViewShell->GetActiveWindow();
+ if (!pViewShell)
+ return {};
- LokChartHelper aChartHelper(pViewShell->GetViewShell());
- VclPtr<vcl::Window> pChartWindow = aChartHelper.GetWindow();
- if (pChartWindow)
- pWindow = pChartWindow;
+ SfxViewShell* pSfxViewShell = pViewShell->GetViewShell();
+ if (VclPtr<vcl::Window> pWindow = LokChartHelper(pSfxViewShell).GetWindow())
+ return pWindow;
+ if (VclPtr<vcl::Window> pWindow = LokStarMathHelper(pSfxViewShell).GetWidgetWindow())
+ return pWindow;
- return pWindow;
+ return pViewShell->GetActiveWindow();
}
void SdXImpressDocument::setPartMode( int nPartMode )
@@ -2611,6 +2611,9 @@ void SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount, i
nCount, nButtons, nModifier,
fScale, fScale))
return;
+ if (LokStarMathHelper(pViewShell->GetViewShell())
+ .postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier, fScale, fScale))
+ return;
// check if the user hit a chart which is being edited by someone else
// and, if so, skip current mouse event