summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-11-28 09:06:23 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-11-28 11:18:51 +0100
commit7765b442e13048f857fd7ee49ced1731caee297e (patch)
tree488cf04399f01c2504b144b9582b55fbe8f6cc64 /sw/inc
parentb1b77b4005ceaeb2b9bc11d8a405bb5a467e1d86 (diff)
sw: add a new .uno:TextFormFields UNO command
Currently .uno:TextFormField can be used to insert a new fieldmark, but then there is no way to update it. Also, there is no way to update several fieldmarks at the same time. Given that the "ADDON" field type in a field mark can be used by extensions like Zotero, it's useful in case these fieldmarks can be not only inserted, but they can be also updated. This works by (in the LOK case) calling getCommandValues() with .uno:TextFormFields, and then once the client generates the new expanded values, there is no way to insert these updated expanded values into the document currently. Fix this by adding a new .uno:TextFormFields UNO command that can update all fieldmarks matching a certain prefix (looking at their field command). This allows e.g. updating all Zotero citations or the bibliography, but the API is generic to support any kind of ADDON fields. Similar to insertion, the content can be multi-paragraph, formatted HTML. This required adjusting SfxUnoAnyItem::CreateDefault(), this way an UNO command parameter can be an array of beans::PropertyValues, which is how the client can provide details of multiple fieldmarks. Change-Id: I44a1b1495ead79b92ccd0c9f6412a34cbec5d68b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143361 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/cmdid.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index c0d31883c3e0..838ccde78c83 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -310,6 +310,8 @@ class SwUINumRuleItem;
#define FN_PROTECT_FIELDS (FN_INSERT2 + 26)
#define FN_PROTECT_BOOKMARKS (FN_INSERT2 + 27)
+#define FN_UPDATE_TEXT_FORMFIELDS (FN_INSERT2 + 28)
+
// clipboard table content
#define FN_PASTE_NESTED_TABLE (FN_INSERT2 + 30) /* instead of the cell-by-cell copy between source and target tables */
#define FN_TABLE_PASTE_ROW_BEFORE (FN_INSERT2 + 31) /* paste table as new table rows */