Apache OpenOffice (AOO) Bugzilla – Issue 77227
Nested table anchor returns the same table rather than parent
Last modified: 2013-02-24 21:06:38 UTC
The problem is that the anchor.text of a nested table does not return the text of the table that the nested table is in, it returns its own text. For a table that is not nested it correctly returns the text that contains the table. The following basic macro fragment is a cut down version of a macro for determining the location of the insertion point (main body of the document, header, footer, frame, etc). oVC = thisComponent.CurrentController.ViewCursor oText = oVC.text while oText.getImplementationName = "SwXCell" print oText.createTextCursor.textTable.name oText = oText.createTextCursor.textTable.anchor.text wend msgbox oText.getImplementationName The problem exists in OOo2.2 for Linux (SuSe10.2), OOo2.2 for Windows (Windows2000), and OOo2.1 for X11. From issue 27268 I gather that the precise location of an anchor is not returned but it would seem reasonable that at least the correct text area is returned. How else can one ascertain what type of area the current insertion point is in? I haven't found a work around for this issue.
Created attachment 45040 [details] Writer file with nested tables and macro to demonstrate problems with anchor.text for nested tables.
jsc -> tl: can you please check this
Confirming with 2.2 on WinXP - as described.
.
set target from 2.x to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x