sw/source/core/crsr/bookmark.cxx | 4 ++-- sw/source/core/docnode/nodes.cxx | 3 ++- sw/source/core/txtnode/atrref.cxx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-)
New commits: commit 7595f39230ab7fada9fb15aca08cbdef81fe79e1 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Mon Jan 23 22:34:29 2023 +0530 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Jan 25 08:33:48 2023 +0000 sw: lok: avoid creating callback json if kit is not active Signed-off-by: Pranam Lashkari <lpra...@collabora.com> Change-Id: I60ae5a37acdbe4ea01b730702cc499833ce5b77c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146036 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146102 Tested-by: Jenkins 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();