summaryrefslogtreecommitdiff
path: root/sw/sdi
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-01-10 08:16:47 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-01-10 08:11:17 +0000
commit71a479afb7e9762de930361e6089e23ab8d4af74 (patch)
treec81d1cecfbd9d5d7a099df6ba0c0ddb3926ef7f1 /sw/sdi
parent26d74a57d54327b9fd562065d04d867852ce8e8a (diff)
sw: add a new .uno:UpdateSections command
There was LOK API to insert a new section with provided HTML content and to query it, but there was no LOK API to update such created section with new names/contents. This is needed in case Zotero wants to store citations with refmarks, in which case it wants to store the bibliography with sections. Introduce a .uno:UpdateSections UNO command that can do this: the sections will be renamed if necessary & the content will be updated. The content update is reasonably straightforward, because the section always contains at least one empty paragraph, so there is no danger in simply deleting the old content before inserting the new one. This is similar to babba472391d26aed68d7ac31c7a918c08e65256 (sw, UpdateFields: add new TypeName, NamePrefix and Fields parameters, 2023-01-04), but that was for refmarks / citations, this is for sections / bibliography. Change-Id: Idde6d5ed1b0f25f40df502bb6b7e7ca590ef9151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145249 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/sdi')
-rw-r--r--sw/sdi/_textsh.sdi6
-rw-r--r--sw/sdi/swriter.sdi14
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 6e77c6d15c21..f712ea376776 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -152,6 +152,12 @@ interface BaseText
StateMethod = GetState ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
+ FN_UPDATE_SECTIONS
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+ ]
FN_SET_REMINDER
[
ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 48131d6126f1..bc0c5456aef8 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2600,6 +2600,20 @@ SfxVoidItem UpdateBookmarks FN_UPDATE_BOOKMARKS
GroupId = SfxGroupId::Insert;
]
+SfxVoidItem UpdateSections FN_UPDATE_SECTIONS
+(SfxStringItem SectionNamePrefix FN_PARAM_1, SfxUnoAnyItem Sections FN_PARAM_2)
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ GroupId = SfxGroupId::Insert;
+]
+
SfxVoidItem SetReminder FN_SET_REMINDER
[