Re: problem of determining the location in the document

Fernand Vanrie <[email protected]> Wed, 26 Jan 2011 15:56:52 +0100
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
  Zbigniew ,

a Viewcursor tell's you if you are in a TextTable, cell , TextFrame, 
Textsection

the Viewcursor.position  is  the position in the document.

Witht this ellements you always know where you are in the document,  no ?

Say you have a Table2 in a cell of Table1

If you know the "start"  and dimensions of Table1 , then you can know if 
Table2 is inside or outside Table1

Hope it helps

Fernand
> Hello
>
> I have problem in finding relation between placement of a text section
> and a text range .
> Things are easy when section and range are placed in main document,
> and get complicated when at least one of them is "nested" inside text table.
> In this case they belong to differend XText object and
> XTextRangeCompare can not be used (exception  would be thrown).
> The only reasonable way to do this seems to be to compare of an anchor
> of the nested XText with position of the section/range placed in main
> document.
>
> Problem is that I don't know which one is nested (posibly both of them
> are nested).
> My question is: how can I determin relation between two XText objects
> which are part of one document.
>
> Finding out that XText is nested and determination of its parent would
> be very helpful.
>
> I wouldn't like to "steal" text view cursor from user to figure it
> out, and would love to find solution based on "model level" analize.
>
>
> Best regards
> Zbyszek
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]