summaryrefslogtreecommitdiff
path: root/sw/source/uibase/wrtsh/wrtsh3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/wrtsh/wrtsh3.cxx')
-rw-r--r--sw/source/uibase/wrtsh/wrtsh3.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/sw/source/uibase/wrtsh/wrtsh3.cxx b/sw/source/uibase/wrtsh/wrtsh3.cxx
index 978f95397b52..fcb123662bcf 100644
--- a/sw/source/uibase/wrtsh/wrtsh3.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh3.cxx
@@ -29,6 +29,9 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <osl/diagnose.h>
#include <sfx2/dispatch.hxx>
+#include <comphelper/lok.hxx>
+#include <tools/json_writer.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <swmodule.hxx>
#include <wrtsh.hxx>
@@ -100,8 +103,19 @@ bool SwWrtShell::GotoContentControl(const SwFormatContentControl& rContentContro
{
// Replace the placeholder image with a real one.
GetView().StopShellTimer();
- GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHANGE_PICTURE,
- SfxCallMode::SYNCHRON);
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ tools::JsonWriter aJson;
+ aJson.put("action", "change-picture");
+ std::unique_ptr<char, o3tl::free_delete> pJson(aJson.extractData());
+ GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_CONTENT_CONTROL,
+ pJson.get());
+ }
+ else
+ {
+ GetView().GetViewFrame()->GetDispatcher()->Execute(SID_CHANGE_PICTURE,
+ SfxCallMode::SYNCHRON);
+ }
pContentControl->SetShowingPlaceHolder(false);
}
return true;