summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-02 11:03:08 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-05 23:38:29 +0100
commitccb0ad61d3ccd3eed3c422dcd4b87486abcf83fc (patch)
tree6b86af36810e7e965166a0e446320d81a849a149 /sfx2
parent033a342a630dbb6329962156727e621866b77b48 (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> (cherry picked from commit 14ed342dd3f4cae607f7785905787f73c7b1fde2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142155 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/lokstarmathhelper.cxx23
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(