Association between ToC index object and its paragraph content
mstahl at redhat.com
Tue Dec 12 12:27:55 UTC 2017
On 12.12.2017 11:04, Jens Tröger wrote:
> Thanks Miklos!
> Interesting detail though: for any number of XTextContent objects (i.e. paragraphs with implementationName=SwXParagraph) which represent _the same_ paragraph in the document, there’s no real way to tell that these objects do, in fact, represent the same paragraph?
actually you can, because the SwXParagraph instance is cached, so if
such an object already exists at the time when a new one is to be
created the existing one is reused.
in C++ you can compare that via just 2 css::uno::Reference<...> and
operator==, not sure how other UNO language bindings compare the object
identity, but it should be possible.
the only exception to this is if there is a paragraph enumeration that
partially selects a paragraph - those are never cached.
(also, not every UNO document model service in Writer implements such
More information about the LibreOffice