Association between ToC index object and its paragraph content
Andrew Pitonyak
andrew at pitonyak.org
Tue Dec 12 17:15:16 UTC 2017
Disclaimer: I have not taken the time to look at the problem, but, if
you have a text range, or have the ability to get a text range out of
what you have, then you can compare the starting and ending positions.
You might need to create a text cursor from the range to do this. I do
not have the ability to test this at the moment, but that is where I
would look if I needed to answer a similar question. Note also that with
an appropriate cursor, you can do things such as jump to the start and
end of a paragraph.
If a paragraph contains content that uses a different Text object, or
you happen to be trying to compare content that lives in different text
objects, this will fail; for example, each cell in a Text Table uses its
own Text object if my memory serves me correctly. This means that you
cannot compare the location of an object in one cell with that in
another cell or outside the text table.
On 2017-12-12 5: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?
>
> Huh. Cheers,
> Jens
>
>
>> On Dec 12, 2017, at 19:37, Miklos Vajna <vmiklos at collabora.co.uk>
>> wrote:
>>
>> https://lists.freedesktop.org/archives/libreoffice/2017-December/079050.html
>> has code samples on how the reference-to-bookmark is represented as
>> a
>> HyperlinkURL property, and how the bookmark is a Bookmark text
>> portion.
>> There is no closer connection between these two, I think.
>>
>> Regards,
>> Miklos
>
> --
> Jens Tröger
> http://savage.light-speed.de/
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20171212/ec20183b/attachment.html>
More information about the LibreOffice
mailing list