summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-08-15 14:31:15 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-08-17 07:19:01 +0200
commitbb6c70f7a9af806347a1e1401a9cce2ad41bc81b (patch)
treeae09c08423c85dec568e96779a9c3ccf66441f13 /starmath
parentf7e0493987f4d2d821d2724e9fef018676af5ddf (diff)
lok: register view callback also for nested sm view
This allows to send context change events that originate in the embedded views. Change-Id: I574ca347a2ffa67f9645a2ee790e42088ad8721f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138303 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/view.hxx1
-rw-r--r--starmath/source/view.cxx21
2 files changed, 22 insertions, 0 deletions
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 45df0f425574..0a18e0084435 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -289,6 +289,7 @@ class SmViewShell final : public SfxViewShell
virtual void OuterResizePixel(const Point &rOfs, const Size &rSize) override;
virtual void QueryObjAreaPixel( tools::Rectangle& rRect ) const override;
virtual void SetZoomFactor( const Fraction &rX, const Fraction &rY ) override;
+ virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const override;
public:
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 39676971a93f..add20227a808 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -32,6 +32,7 @@
#include <comphelper/storagehelper.hxx>
#include <comphelper/string.hxx>
#include <i18nutil/unicode.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <officecfg/Office/Common.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
@@ -2121,6 +2122,9 @@ public:
{
SfxBaseController::attachFrame(xFrame);
+ if (comphelper::LibreOfficeKit::isActive())
+ CopyLokViewCallbackFromFrameCreator();
+
// No need to call mpSelectionChangeHandler->Connect() unless SmController implements XSelectionSupplier
mpSelectionChangeHandler->selectionChanged({}); // Installs the correct context
}
@@ -2271,4 +2275,21 @@ void SmViewShell::ZoomByItemSet(const SfxItemSet *pSet)
}
}
+OString SmViewShell::getLOKPayload(int nType, int nViewId, bool* ignore) const
+{
+ switch (nType)
+ {
+ case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
+ case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
+ case LOK_CALLBACK_TEXT_SELECTION:
+ case LOK_CALLBACK_TEXT_SELECTION_START:
+ case LOK_CALLBACK_TEXT_SELECTION_END:
+ case LOK_CALLBACK_TEXT_VIEW_SELECTION:
+ if (ignore)
+ *ignore = true;
+ return {};
+ }
+ return SfxViewShell::getLOKPayload(nType, nViewId, ignore); // aborts
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */