Support named references

37 views
Skip to first unread message

Cafebabe

unread,
May 25, 2009, 12:20:08 PM5/25/09
to jOpenDocument
Salut!

OpenOffice supports named references (http://plan-b-for-openoffice.org/
glossary/term/cell-reference-name).

Sad that jOpenDocument don’t support them and a call like

sheet.getCellAt( "addressline1" ).setValue( value );

just gives a (funny) exception.

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index:
883191396, Size: 1024

Named references (like my addressline1) are a big advantage in
processing documents because absolute references are just clumsy.

And if the value is "out of range" maybe not to throw an
IndexOutOfBoundsException but an IllegalArgumentException with a
message like: "Named references are not supported right now" Thanks
god we have range checks in Java :)

Sylvain Cuaz

unread,
May 28, 2009, 11:42:11 AM5/28/09
to jopend...@googlegroups.com
Cafebabe a écrit :
> Salut!

Salut,

> OpenOffice supports named references (http://plan-b-for-openoffice.org/
> glossary/term/cell-reference-name).
>
> Sad that jOpenDocument don’t support them

It does in Spreadsheet (since a named cell can be in any sheet) but
only for getting the value : public Object getValueAt(String ref)

We will add a method like getCellAt(String ref) in the next version

> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index:
> 883191396, Size: 1024
>

> And if the value is "out of range" maybe not to throw an
> IndexOutOfBoundsException but an IllegalArgumentException with a
> message like: "Named references are not supported right now"

Actually it does, it checks if the string conforms to
([\p{Alpha}]+)([\p{Digit}]+) Sadly "addressline1" does :-)

Cheers,
Sylvain

Reply all
Reply to author
Forward
0 new messages