diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-11-25 12:30:56 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-11-25 16:16:39 +0100 |
commit | 24219cc1e9829f82a533667aef0f51b6a7df6fc2 (patch) | |
tree | 7e61f8973223ea3a9658b8c85773bf454680e7aa /include | |
parent | 534d43ac5b51c57c01f275d6ecb320ee9e51000a (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 'include')
-rw-r--r-- | include/vcl/ITiledRenderable.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index 3bf7bcdddacb..771ecf225c5a 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -368,6 +368,11 @@ public: * Allow / disable drawing current text edit (used in Impress for slide previews) */ virtual void setPaintTextEdit(bool) {} + + /// Returns a json mapping of the possible values for the given command. + virtual void getCommandValues(tools::JsonWriter& /*rJsonWriter*/, std::string_view /*rCommand*/) + { + } }; } // namespace vcl |