diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2023-01-23 19:55:58 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-01-24 15:37:30 +0000 |
commit | 4223b65194bfc5ecf9448c1c4b8236464654bd3d (patch) | |
tree | c3be47d98c76d038d60679d74e14c09f4f7f7575 | |
parent | f6d7d914049fc16b051ccdb7a6aaa54bb13f83d9 (diff) |
sw: send LOK call back on section deletion
this helps with zotero when user deletes or undo a bibliography stored as a section
without this online will be unaware of any such changes made by user
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I6a8ae3924d548e97299a8d74f8c93c3345d1a430
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146007
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index d352cfb41057..c59b949a94df 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -21,6 +21,9 @@ #include <libxml/xmlwriter.h> #include <osl/diagnose.h> +#include <tools/json_writer.hxx> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <sfx2/viewsh.hxx> #include <node.hxx> #include <doc.hxx> @@ -2296,6 +2299,22 @@ void SwNodes::RemoveNode( SwNodeOffset nDelPos, SwNodeOffset nSz, bool bDel ) // 'Extra Redlines' array pTableNode->RemoveRedlines(); } + + SwSectionNode* pSectionNode = pNode->GetSectionNode(); + if (pSectionNode && !GetDoc().IsClipBoard() && SfxViewShell::Current()) + { + OUString fieldCommand = pSectionNode->GetSection().GetSectionName(); + tools::JsonWriter aJson; + aJson.put("commandName", ".uno:DeleteSection"); + aJson.put("success", true); + { + auto result = aJson.startNode("result"); + aJson.put("DeleteSection", fieldCommand); + } + + SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_UNO_COMMAND_RESULT, aJson.extractData()); + + } } SwNodeOffset nEnd = nDelPos + nSz; |