Association between ToC index object and its paragraph content
vmiklos at collabora.co.uk
Fri Dec 8 09:03:57 UTC 2017
On Thu, Dec 07, 2017 at 07:51:56PM +0100, Jens Tröger <jens.troeger at light-speed.de> wrote:
> Two things. First, I had to call update() on the ToC document index
> object in order to get all links in the document.
Aha, sounds like the two questions from your previous mail are for the
ToC object which is created from the API, not via the UI. If you insert
the ToC on the UI, it's automatically updated after insertion.
> Second, calling update() _duplicated_ each and every entry in the ToC
> which looks like a bug to me (LO 18.104.22.168)…
5.3 is quite old, almost EOL; to discuss problems on this dev list, the
best is if you first try your problem on master (towards 6.1) first.
> I’m still curious though: iterating over the paragraphs, is there any
> other indication than the par’s name that the par is in fact part of the
> ToC index object?
If you know what are the properties of the ToC object (does it only
contain Heading 1 paragraphs? Or also Heading 2? etc), then just
querying the outline numbering property ("OutlineLevel" is the UNO
property name) of the paragraph should work. Or check if it has a
RefHeading bookmark (see my previous mail) if that works better for you.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 181 bytes
Desc: Digital signature
More information about the LibreOffice