diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-02 11:03:08 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-11-05 09:19:07 +0100 |
commit | 14ed342dd3f4cae607f7785905787f73c7b1fde2 (patch) | |
tree | 54a151c6e1c1f041e978563f44736904911c07d1 /sfx2 | |
parent | d8856123f72d243b45fe52b7d3dbb87aa35ce0ba (diff) |
lok: show Math cursor
Change-Id: I17a449f0a0662f0433de9cad1522a090434c1e30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142178
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokstarmathhelper.cxx | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sfx2/source/view/lokstarmathhelper.cxx b/sfx2/source/view/lokstarmathhelper.cxx index fb30d9cee449..8ec65c45a274 100644 --- a/sfx2/source/view/lokstarmathhelper.cxx +++ b/sfx2/source/view/lokstarmathhelper.cxx @@ -122,14 +122,29 @@ vcl::Window* LokStarMathHelper::GetWidgetWindow() return mpWidgetWindow.get(); } +const SfxViewShell* LokStarMathHelper::GetSmViewShell() +{ + if (vcl::Window* pGraphWindow = GetGraphicWindow()) + { + return SfxViewShell::GetFirst(false, [pGraphWindow](const SfxViewShell* shell) { + return shell->GetWindow() && shell->GetWindow()->IsChild(pGraphWindow); + }); + } + return nullptr; +} + +tools::Rectangle LokStarMathHelper::GetBoundingBox() const +{ + return mpIPClient ? mpIPClient->GetObjArea() : tools::Rectangle{}; +} + bool LokStarMathHelper::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier, double /*fScaleX*/, double /*fScaleY*/) { - if (vcl::Window* pWindow = GetWidgetWindow()) + const tools::Rectangle rBBox = GetBoundingBox(); + if (Point aMousePos(nX, nY); rBBox.Contains(aMousePos)) { - Point aMousePos(nX, nY); - tools::Rectangle rBBox = mpIPClient->GetObjArea(); - if (rBBox.Contains(aMousePos)) + if (vcl::Window* pWindow = GetWidgetWindow()) { aMousePos -= rBBox.TopLeft(); LokMouseEventData aMouseEventData( |