diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-01-11 15:56:31 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-01-11 22:54:33 +0000 |
commit | ea208f6004770eb4b81d28e6930cd0c7bd5d8f12 (patch) | |
tree | ebc565bbd07967eeab8832f029b8e51726280278 /sw/sdi | |
parent | 67471b3a7fb33884e70e29163b4eddf47fa85115 (diff) |
sw: add a new .uno:UpdateBookmark UNO command
It is possible to update all bookmarks (having a certain name prefix)
and their contet, but one can't update the bookmark under the cursor,
which is needed for Zotero citation clusters.
Fix the problem by adding a new .uno:UpdateBookmark UNO command that can
update the (innermost) bookmark under the current cursor.
This can be implemented on top of the recently added
IDocumentMarkAccess::getBookmarkFor().
The UNO command is intentionally hidden from the customize dialog since
it only makes sense to invoke it from a macro / API with parameters, not
interactively.
Change-Id: I3e750dfb637f50716be1155a94bc986131b84f20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145351
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/sdi')
-rw-r--r-- | sw/sdi/_textsh.sdi | 5 | ||||
-rw-r--r-- | sw/sdi/swriter.sdi | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 99f50c8e3b27..f08e0b21b675 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -152,6 +152,11 @@ interface BaseText StateMethod = GetState ; DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] + FN_UPDATE_BOOKMARK + [ + ExecMethod = Execute ; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] FN_UPDATE_SECTIONS [ ExecMethod = Execute ; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 76939d94c03a..ebded3b24b72 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -2600,6 +2600,20 @@ SfxVoidItem UpdateBookmarks FN_UPDATE_BOOKMARKS GroupId = SfxGroupId::Insert; ] +SfxVoidItem UpdateBookmark FN_UPDATE_BOOKMARK +(SfxStringItem BookmarkNamePrefix FN_PARAM_1, SfxUnoAnyItem Bookmark FN_PARAM_2) +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + GroupId = SfxGroupId::Insert; +] + SfxVoidItem UpdateSections FN_UPDATE_SECTIONS (SfxStringItem SectionNamePrefix FN_PARAM_1, SfxUnoAnyItem Sections FN_PARAM_2) [ |