Writer Table Columns Access via Java API

fxruby fxruby at siberas.de
Mon May 6 09:00:37 UTC 2019


I'm currently writing a program using the libreoffice java api.
It's a programm controlling the Writer component. I can insert tables,
place images inside the table and also change the height of table rows.
Now I want to change the width of a table column. But when I try to get
a column, I always get an empty object.

Here's what I do (it's JRuby code, but very similar to java):

[27] pry(main)> table.java_object
[28] pry(main)> columns = table.columns
=> #<Java::Default::$Proxy60:0x5b799640>
[29] pry(main)> columns.java_object
[30] pry(main)> columns.getCount
=> 12
[31] pry(main)> col = columns.getByIndex 0
=> nil

I always get nil :(

There's some kind of functionality behind the method, because if I enter
a wrong index, an exception is raised

[32] pry(main)> col = columns.getByIndex 13
[33] pry(main)>

Is this a bug or what am I doing wrong?

kind regards,


More information about the LibreOffice mailing list