summaryrefslogtreecommitdiff
path: root/sw/sdi
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-01-06 10:08:00 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-01-06 11:32:29 +0000
commit337416dafb66ed8f930d2d69e83fae438fc85f3c (patch)
tree5dd87bfa6c96de9a5e2c611b8cd99d690543e1d4 /sw/sdi
parentcfcd5aa6898654ad3b469ee23f2b27eef5e4a565 (diff)
sw: add a new .uno:UpdateTextFormField UNO command
It is possible to update all fieldsmarks (of a certion type, of a certain field command prefix), but one can't update the fieldmark under the cursor, which is needed for Zotero citation clusters. To make this more complex, insertion inside an existing fieldmark is explicitly not wanted, see commit a178a2ac6df8dc63a7ab8d4a19b90ae8a17baca4 (sw UI: fix crash on inserting a fieldmark inside a fieldmark, 2023-01-02). Fix the problem by adding a new .uno:UpdateTextFormField UNO command that can update the (innermost) fieldmark under the current cursor. The uno command is intentionally hidden from the customize dialog since it only makes sense to invoke it from a macro / API with parameters, not interactively. Change-Id: I46fc4f701a20839945d765eb13aec7362ab83788 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145135 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 de4f50393c07..6e77c6d15c21 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -1808,6 +1808,12 @@ interface BaseText
StateMethod = StateField ;
]
+ FN_UPDATE_TEXT_FORMFIELD
+ [
+ ExecMethod = ExecField ;
+ StateMethod = StateField ;
+ ]
+
FN_PROTECT_FIELDS
[
ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index a819927a5576..15760fd72c02 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -8316,6 +8316,20 @@ SfxVoidItem TextFormFields FN_UPDATE_TEXT_FORMFIELDS
GroupId = SfxGroupId::Controls;
]
+SfxVoidItem UpdateTextFormField FN_UPDATE_TEXT_FORMFIELD
+(SfxStringItem FieldType FN_PARAM_1, SfxStringItem FieldCommandPrefix FN_PARAM_2, SfxUnoAnyItem Field FN_PARAM_3)
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ GroupId = SfxGroupId::Controls;
+]
+
SfxVoidItem CheckBoxFormField FN_INSERT_CHECKBOX_FORMFIELD
[