diff options
author | Pranam Lashkari <lpranam@collabora.com> | 2023-01-19 00:14:50 +0530 |
---|---|---|
committer | Pranam Lashkari <lpranam@collabora.com> | 2023-01-23 13:03:03 +0000 |
commit | 4ca01e91d72df3f69d8b5c7a4d6fddd863a396fc (patch) | |
tree | 12d7cbc351a11f100966cdcab089851d5f065f60 /sw | |
parent | 938f2754d67173ceae8db043e0aac1315210850e (diff) |
sw: send LOK call back on fieldmark deletion
this helps with zotero when user deletes a fieldmark or use undo
without this online will be unaware of any such changes made by user
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I93cf102c20b3861140508aee5d81e65f5b9207ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145753
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 3a6b7e2c07566f22f33189ad4e8393767df5b9f8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146014
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/bookmark.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/inc/bookmark.hxx | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index 2520e6312b79..b7e5b4a7850b 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -48,6 +48,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <rtl/strbuf.hxx> #include <strings.hrc> +#include <tools/json_writer.hxx> using namespace ::sw::mark; using namespace ::com::sun::star; @@ -562,6 +563,25 @@ namespace sw::mark m_aName = rName; } + TextFieldmark::~TextFieldmark() + { + SfxViewShell* pViewShell = SfxViewShell::Current(); + if (!pViewShell) + return; + + OUString fieldCommand; + (*GetParameters())[OUString(ODF_CODE_PARAM)] >>= fieldCommand; + tools::JsonWriter aJson; + aJson.put("commandName", ".uno:DeleteTextFormField"); + aJson.put("success", true); + { + auto result = aJson.startNode("result"); + aJson.put("DeleteTextFormField", fieldCommand); + } + + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_UNO_COMMAND_RESULT, aJson.extractData()); + } + void TextFieldmark::InitDoc(SwDoc& io_rDoc, sw::mark::InsertMode const eMode, SwPosition const*const pSepPos) { diff --git a/sw/source/core/inc/bookmark.hxx b/sw/source/core/inc/bookmark.hxx index a349c9063b76..b4630b18701c 100644 --- a/sw/source/core/inc/bookmark.hxx +++ b/sw/source/core/inc/bookmark.hxx @@ -239,6 +239,7 @@ namespace sw::mark { { public: TextFieldmark(const SwPaM& rPaM, const OUString& rName); + ~TextFieldmark(); void InitDoc(SwDoc& io_rDoc, sw::mark::InsertMode eMode, SwPosition const* pSepPos) override; void ReleaseDoc(SwDoc& rDoc) override; |