diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-16 23:01:10 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-16 22:15:19 +0100 |
commit | a81e957f5026373f3935390c786c21416fc74fcc (patch) | |
tree | a6852bb6c2c8c99e6f848217588c0944dcb3dcd9 /sw | |
parent | 7060192b6facd92cadb5bb084052903f2695d67d (diff) |
lok: handle mouse/keyboard events in Math embedded in Calc
And extract the identical code used in all components into
static SfxLokHelper methods.
Change-Id: I6556b1b996936835ecfc0d59e2c1dd1ef6380db2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142793
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 146384c452f2..0f0fb093cb3e 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3537,9 +3537,7 @@ VclPtr<vcl::Window> SwXTextDocument::getDocWindow() if (!pView) return {}; - if (VclPtr<vcl::Window> pWindow = LokChartHelper(pView).GetWindow()) - return pWindow; - if (VclPtr<vcl::Window> pWindow = LokStarMathHelper(pView).GetWidgetWindow()) + if (VclPtr<vcl::Window> pWindow = SfxLokHelper::getInPlaceDocWindow(pView)) return pWindow; return &(pView->GetEditWin()); @@ -3637,24 +3635,10 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int SwViewOption aOption(*(pWrtViewShell->GetViewOptions())); double fScale = aOption.GetZoom() / o3tl::convert(100.0, o3tl::Length::px, o3tl::Length::twip); - // check if the user hit a chart/math object which is being edited by this view - if (LokChartHelper(m_pDocShell->GetView()).postMouseEvent(nType, nX, nY, - nCount, nButtons, nModifier, - fScale, fScale)) - return; - if (LokStarMathHelper(m_pDocShell->GetView()).postMouseEvent(nType, nX, nY, - nCount, nButtons, nModifier, - fScale, fScale)) + if (SfxLokHelper::testInPlaceComponentMouseEventHit( + m_pDocShell->GetView(), 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 - if (nType != LOK_MOUSEEVENT_MOUSEMOVE) - { - if (LokChartHelper::HitAny(Point(nX, nY))) - return; - } - SwEditWin& rEditWin = m_pDocShell->GetView()->GetEditWin(); LokMouseEventData aMouseEventData(nType, Point(nX, nY), nCount, MouseEventModifiers::SIMPLECLICK, |