summaryrefslogtreecommitdiff
path: root/sfx2
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 /sfx2
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 'sfx2')
-rw-r--r--sfx2/source/view/frame.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index eda62d4a29e9..f65d958e3fc4 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -58,7 +58,10 @@ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::container;
-SfxPoolItem* SfxUnoAnyItem::CreateDefault() { SAL_WARN( "sfx", "No SfxUnoAnyItem factory available"); return nullptr; }
+SfxPoolItem* SfxUnoAnyItem::CreateDefault()
+{
+ return new SfxUnoAnyItem(0, uno::Any());
+}
SfxPoolItem* SfxUnoFrameItem::CreateDefault()
{