From 2d4cde2f75d4aaa3a69fdd65ee7584eb15d20275 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 16 Nov 2022 17:40:27 +0300 Subject: 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 --- sw/source/uibase/uno/unotxdoc.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 08746303cecf..146384c452f2 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3534,16 +3534,15 @@ VclPtr SwXTextDocument::getDocWindow() { SolarMutexGuard aGuard; SwView* pView = m_pDocShell->GetView(); + if (!pView) + return {}; if (VclPtr pWindow = LokChartHelper(pView).GetWindow()) return pWindow; if (VclPtr pWindow = LokStarMathHelper(pView).GetWidgetWindow()) return pWindow; - if (pView) - return &(pView->GetEditWin()); - - return {}; + return &(pView->GetEditWin()); } void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence& rArguments) -- cgit