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 2d118d98f48be1d3dd550af3ca4964800703115c Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Mon Jan 23 22:34:29 2023 +0530 Commit: Pranam Lashkari <lpra...@collabora.com> CommitDate: Tue Jan 24 17:51:34 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> diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 71764d28052a..50557f044fdc 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -417,7 +417,7 @@ namespace sw::mark Bookmark::~Bookmark() { - if (GetMarkPos().GetDoc().IsClipBoard()) + if (!comphelper::LibreOfficeKit::isActive() || GetMarkPos().GetDoc().IsClipBoard()) return; SfxViewShell* pViewShell = SfxViewShell::Current(); @@ -589,7 +589,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 c59b949a94df..172be29e067d 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -24,6 +24,7 @@ #include <tools/json_writer.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <sfx2/viewsh.hxx> +#include <comphelper/lok.hxx> #include <node.hxx> #include <doc.hxx> @@ -2301,7 +2302,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 d57aff71e688..2d93d834ae7a 100644 --- a/sw/source/core/txtnode/atrref.cxx +++ b/sw/source/core/txtnode/atrref.cxx @@ -25,6 +25,7 @@ #include <sfx2/viewsh.hxx> #include <tools/json_writer.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <comphelper/lok.hxx> #include <doc.hxx> #include <ndtxt.hxx> @@ -101,7 +102,7 @@ SwTextRefMark::SwTextRefMark( SwFormatRefMark& rAttr, SwTextRefMark::~SwTextRefMark() { - if (GetTextNode().GetDoc().IsClipBoard()) + if (!comphelper::LibreOfficeKit::isActive() || GetTextNode().GetDoc().IsClipBoard()) return; SfxViewShell* pViewShell = SfxViewShell::Current();