sfx2: extend .uno:SetDocumentProperties to update custom doc props

Desktop / LibreOffice - Miklos Vajna [collabora.com] - 30 November 2022 15:51 UTC

Scripting clients (like the LOK API) had a way to get all custom properties where the name matches a certain prefix, but setting such properties was not possible.

.uno:SetDocumentProperties can already show a dialog to edit properties interactively and had a parameter to set some properties in a non-interactive way, but there doesn't seem to be a way to influence custom properties there without using the internal API.

Fix the problem by adding a new UpdatedProperties parameter that allows removing all old custom properties matching the prefix and adding new ones with a single UNO command dispatch.

This is meant to be the write side of the reading commit 5e8f6dcb8ce00d2d5e35b3cf5654187b3068276c (sw lok, .uno:SetDocumentProperties: expose value of custom document properties, 2022-11-29).

Change-Id: Ib7450d4d21285d9a73758e1c172543521fc07cef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143491

afb362c60a18 sfx2: extend .uno:SetDocumentProperties to update custom doc props
comphelper/source/misc/sequenceashashmap.cxx | 8 ++++
sfx2/qa/cppunit/doc.cxx | 60 ++++++++++++++++++++++++++++
sfx2/sdi/sfx.sdi | 2 +-
sfx2/source/doc/objserv.cxx | 57 ++++++++++++++++++++++++++
4 files changed, 126 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share