summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@collabora.com>2024-09-24 13:30:22 +0300
committerMiklos Vajna <vmiklos@collabora.com>2024-12-16 17:47:14 +0100
commit9d9c24328cef503f999bf3a5475743e87a3aff5a (patch)
tree68fbf4de5b547fab928a2c1c95e552b4e43b40cb /sd/source
parent6d1cddea8e4e19287891ab8fb7e3774ae9976ea1 (diff)
cool#7406 Inform lokit side about the grid state.
When grid in impress or draw is turned on, we need to inform libreofficekit. So it can show relevant UI and act accordingly. Same goes for griduse command. Also add a test for the new state callbacks. Change-Id: Ia5737ca0088e434f826eb7c40b0bec59049432af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178578 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/view/drviewsg.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx
index c0e71e05ad7e..149894fcd0e2 100644
--- a/sd/source/ui/view/drviewsg.cxx
+++ b/sd/source/ui/view/drviewsg.cxx
@@ -31,6 +31,10 @@
#include <app.hrc>
+#include <comphelper/lok.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
#include <drawdoc.hxx>
#include <sdmod.hxx>
#include <optsitem.hxx>
@@ -119,12 +123,24 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
case SID_GRID_VISIBLE: // not here yet!
{
pOptions->SetGridVisible( !mpDrawView->IsGridVisible() );
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OString state = !mpDrawView->IsGridVisible() ? ".uno:GridVisible=true"_ostr: ".uno:GridVisible=false"_ostr;
+ SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, state);
+ }
}
break;
case SID_GRID_USE:
{
pOptions->SetUseGridSnap( !mpDrawView->IsGridSnap() );
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OString state = !mpDrawView->IsGridSnap() ? ".uno:GridUse=true"_ostr: ".uno:GridUse=false"_ostr;
+ SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, state);
+ }
}
break;