Hi Robert,
find some comments inline..

Robert Vojta wrote:
Hallo all,

I'm working with text tables a lot and I found some inconsistency from
my point of view. Can you comment them? Shouldn't be behavior of some
functions changed?

1) XTextTable.getCellNames()

This function returns all cell names, even invisible cells. For
example - table with 2/2 rows/columns, merge A1:A2 => A1. This
function returns array "A1, B1, A2, B2" and I expect "A1, B1, B2"
only. There can be cell A2 internally, but this cell doesn't exist
from user POV and from my POV (extension developer) too. There's no
way (or I didn't find it) how to retreive visible cell names only.

If .getCellNames() behavior is correct, it would be nice to have
something like .getVisibleCellNames() or have property "IsVisible" in
CellProperties.
I think getCellNames() should only deliver 'visible' cells. Please submit an issue, if there is no objection against, we will fix it. In OOo3.0 you are able to query the "RowSpan" property. If the value is negative, it is an invisible cell.
2) XTextTable.createCursorByCellName( name )

Create a table with 6 rows and 1 column. Merge last three cells (A4:A6
=> A4). And now ...

 - cursor = XTextTable.createCursorByCellName( "A6" )
 - cursor.getRangeName() => "A6"
 - cursor.goUp( 1, false )
 - cursor.goDown( 1, false )
 - cursor.getRangeName() => "A4" != "A6"

... I expect XTextTable.createCursorByCellName( "A6" ).getRangeName()
to return "A4" and not "A6".
Yes, that's the current behavior. After merging you get the cellcursor of an invisible cell but if you travel (goUp, goDown) you will leave this invisible cell and you will not enter it again. There are two possibilities, we could deny the createCursor for an invisible cell or we could deliver the cellCursor for the "master" cell.
I prefer the first solution, what do you think?
BTW: if you have only 1 column and 6 rows, you will not be able to create a cursor for A6 because A6 vanishes if you merge A4:A6, doesn't it?
All these things I found when I was trying to work with complex tables
via API => big pain, at least for me.
You will help us to get a better API even for complex tables if you continue to report your problems and file issues for it!
Thank you
   Andreas

--
Andreas Martens (ama) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to