summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-11-25 12:30:56 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-11-25 16:16:39 +0100
commit24219cc1e9829f82a533667aef0f51b6a7df6fc2 (patch)
tree7e61f8973223ea3a9658b8c85773bf454680e7aa /sw/inc
parent534d43ac5b51c57c01f275d6ecb320ee9e51000a (diff)
sw lok, .uno:TextFormFields: expose field code of fieldmarks
The fieldmarks in a document were kind of invisible for LOK clients previously. The Zotero use-case requires a way to fetch certain types of fieldmarks from a document, to be able to update them and then write back those updated versions to the document later. Fix this by introducing a new .uno:TextFormFields, you can get its value using the getCommandValues() LOK API. This allows filtering for a certain field command prefix, which is generic, but e.g. in the Zotero case allows getting the citations or the bibliography. The returned JSON is an array of matching fieldmarks, containing their type and field command. It seems there is no way to return the field result, till the motivation is to just update that field result. (If there will be need, the field result can be added.) Do this in a way that next time we add a Writer-specific command (to be able to return its values), there will be no need to touch include/vcl/ITiledRenderable.hxx, causing a large rebuild. Change-Id: I2ef1159bec4034bbdd6b4ba00715a69423106edd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143275 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/unotxdoc.hxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 90f605406d5b..150ea15af498 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -459,6 +459,9 @@ public:
/// @see vcl::ITiledRenderable::executeContentControlEvent().
void executeContentControlEvent(const StringMap& aArguments) override;
+ /// @see vcl::ITiledRenderable::getCommandValues().
+ void getCommandValues(tools::JsonWriter& rJsonWriter, std::string_view rCommand) override;
+
void Invalidate();
void Reactivate(SwDocShell* pNewDocShell);
SwXDocumentPropertyHelper * GetPropertyHelper ();