summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2023-01-23 22:34:29 +0530
committerMiklos Vajna <vmiklos@collabora.com>2023-01-25 08:33:48 +0000
commit7595f39230ab7fada9fb15aca08cbdef81fe79e1 (patch)
treee798156e8ce1d391bfcc99850b7d00e7aae2819b
parent15397a10585e223733c651287c9f84a719180128 (diff)
sw: lok: avoid creating callback json if kit is not active
Signed-off-by: Pranam Lashkari <lpranam@collabora.com> Change-Id: I60ae5a37acdbe4ea01b730702cc499833ce5b77c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146036 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146102 Tested-by: Jenkins
-rw-r--r--sw/source/core/crsr/bookmark.cxx4
-rw-r--r--sw/source/core/docnode/nodes.cxx3
-rw-r--r--sw/source/core/txtnode/atrref.cxx3
3 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx
index c43dd04c2496..faaec4b28377 100644
--- a/sw/source/core/crsr/bookmark.cxx
+++ b/sw/source/core/crsr/bookmark.cxx
@@ -422,7 +422,7 @@ namespace sw::mark
void Bookmark::sendLOKDeleteCallback()
{
- if (GetMarkPos().GetDoc().IsClipBoard())
+ if (!comphelper::LibreOfficeKit::isActive() || GetMarkPos().GetDoc().IsClipBoard())
return;
SfxViewShell* pViewShell = SfxViewShell::Current();
@@ -586,7 +586,7 @@ namespace sw::mark
TextFieldmark::~TextFieldmark()
{
- if (GetMarkPos().GetDoc().IsClipBoard())
+ if (!comphelper::LibreOfficeKit::isActive() || GetMarkPos().GetDoc().IsClipBoard())
return;
SfxViewShell* pViewShell = SfxViewShell::Current();
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 7fcba8858721..16fb8eb5ecd1 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -23,6 +23,7 @@
#include <tools/json_writer.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/viewsh.hxx>
+#include <comphelper/lok.hxx>
#include <node.hxx>
#include <doc.hxx>
@@ -2444,7 +2445,7 @@ void SwNodes::RemoveNode( SwNodeOffset nDelPos, SwNodeOffset nSz, bool bDel )
}
SwSectionNode* pSectionNode = pNode->GetSectionNode();
- if (pSectionNode && !GetDoc().IsClipBoard() && SfxViewShell::Current())
+ if (comphelper::LibreOfficeKit::isActive() && pSectionNode && !GetDoc().IsClipBoard() && SfxViewShell::Current())
{
OUString fieldCommand = pSectionNode->GetSection().GetSectionName();
tools::JsonWriter aJson;
diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx
index e38156a9d170..5e2306a8b27c 100644
--- a/sw/source/core/txtnode/atrref.cxx
+++ b/sw/source/core/txtnode/atrref.cxx
@@ -29,6 +29,7 @@
#include <sfx2/viewsh.hxx>
#include <tools/json_writer.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
#include <doc.hxx>
#include <ndtxt.hxx>
@@ -121,7 +122,7 @@ SwTextRefMark::SwTextRefMark( SwFormatRefMark& rAttr,
SwTextRefMark::~SwTextRefMark()
{
- if (GetTextNode().GetDoc().IsClipBoard())
+ if (!comphelper::LibreOfficeKit::isActive() || GetTextNode().GetDoc().IsClipBoard())
return;
SfxViewShell* pViewShell = SfxViewShell::Current();