Re: problem of determining the location in the document

Andrew Douglas Pitonyak <[email protected]> Wed, 26 Jan 2011 21:09:10 -0500
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>

On 01/26/2011 01:53 PM, Zbigniew Szot wrote:
> Thank you for taking interest in my problem.
>
> TextViewCursor/Position is "Controller based" solution.
> I would like to stick to "model based" one.
>
> But you brought me an idea, which now seems obvious.
> I can query  XText about supported services.
> This will give me answer to the question if it is nested.
> It's not direct answer, but it's good enough ( I hope).
Please share any solutions that you find. I see, for example, that if I 
take a text object from a cell, that this supports cell properties and 
provides the cell name, but, it does not provide a link to the 
containing text table. If I create a text cursor from a text object, 
however, that provides access to the TextTable property.

 From the text table, you can grab the anchor. My testing stopped there 
when I managed to crash OOo.

Off hand, I expect that you should be able to walk backwards until you 
finally found the text object  for the document. I suppose that it 
should be mostly obvious how to check for an intersecting text object as 
it were (as in, where in the tree do they meet).

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php