https://bugs.documentfoundation.org/show_bug.cgi?id=172967
Bug ID: 172967
Summary: The UNO API doesn’t provide a way to select multiple
text ranges
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: enhancement
Priority: medium
Component: sdk
Assignee: [email protected]
Reporter: [email protected]
In tdf#172948 the OP requested a new feature of being able to select all
footnotes. I thought this would be quite a nice thing to implement using a
macro. However, I don’t think this is currently possible because there doesn’t
seem to be any way to select multiple ranges using the API.
The selection is set using the XSelectionSupplier::select method which can
accept a range of different types of objects using an Any. The different types
are handled in SwUnoCursorHelper::GetSelectableFromAny. One of the things that
it accepts is an SwXTextRanges, which I guess technically does let you select
multiple ranges. However, there doesn’t seem to be any way to construct one of
these using the UNO API, and even if you could construct one there’s no way to
manipulate it to add ranges.
To fix this I think it would be nice if the select method could accept a
Sequence of XTextRanges. That way you could implement the feature request in
tdf#172948 with a very short macro like this:
def selectAllFootnotes():
doc = XSCRIPTCONTEXT.getDocument()
doc.getCurrentController().select(list(doc.getFootnotes()))
--
You are receiving this mail because:
You are the assignee for the bug.