Problems to access table columns via UNO interface

Helmar Spangenberg hspangenberg at
Thu Mar 8 08:52:15 PST 2012

Hello list,

I have difficulties to access table columns (and rows) via the UNO interface. 
I have no problems to create a table, but I am not able to manipulate the 
properties of the columns.
Basically my code can be nailed down to

Reference<XMultiServiceFactory> docServices (rDocument, UNO_QUERY_THROW);
Reference<XTextTable> tabelle(docServices->
tabelle->initialize(2, 5);
Reference<XTableColumns> tcols (tabelle->getColumns(), UNO_SET_THROW);
Any pval;
pval <<= tcols->getByIndex(2);
Reference<XPropertySet> s_properties(pval, UNO_QUERY_THROW);

Some debugging showed that the method getByIndex returns an Any with a pointer 
to 0. Since in my case "tcols" seems to be initiated correctly
(tcols->getCount() returns 5 as expected, and tcols->hasElements() returns 
can someone please tell me what is wrong in my code!

I am using LO-3.5 as distributed from; I observe this 
behavior under SuSE Linux 12.1 (64bit).

Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the LibreOffice mailing list