Thanks!<неи<неи-----Original Message-----<неиFrom: Peter Eberlein
[mailto:pet....@refofd.verwalt-berlin.de] <неиSent: Thursday, September 19,
2013 5:24 PM<неиTo: api@openoffice.apache.org<неиSubject: Re: Change column
property in XTextTable<неи<неиHi,<неиAm 19.09.2013 13:36, schrieb
K.Misha:<неи> Hello!<неи><неи><неи><неи> I have this
code:<неи><неи><неи><неи> Reference < XTextDocument > xTextDocument
(xWriterComponent,UNO_QUERY);<неи><неи> Reference< XModel > aDrawDoc
(xTextDocument, UNO_QUERY);<неи><неи> Reference<XMultiServiceFactory>
aFact(aDrawDoc,UNO_QUERY);<неи><неи> Reference< XTextTable >
xTextTable(<неи>
aFact->createInstance(OUString::createFromAscii("com.sun.star.text.TextTable
<неи> ")), UNO_QUERY);<неи><неи><неи><неи>
xTextTable->initialize(4,4);<неи><неи><неи><неи> Reference<XText> xText =
xTextDocument->getText();<неи><неи> Reference<XTextRange> xTextRange =
xText->getStart();<неи><неи> Reference<XTextContent>
xTextContent(xTextTable, UNO_QUERY);<неи><неи><неи><неи>
xText->insertTextContent( xTextRange, xTextContent, 0 );<неи><неи><неи><неи>
Reference<XTableColumns> xTableColumns = xTextTable->getColumns();<неи><неи>
Any rCol = xTableColumns->getByIndex(0);<неи><неи><неи><неи> Reference<
XPropertySet > xPropSet2(rCol, UNO_QUERY);<неи><неи> Any mPropVal1 <<=
makeAny((unsigned short)150);<неи><неи><неи><неи> But here i have an
error:<неи><неи>
xPropSet2->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width")),<
неи> mPropVal1);<неи><неи><неи><неи> Can you help me with changing column
properties in text table?<неи><неи<неиyou have to use the
com.sun.star.text.TableColumnSeparator.<неи<неиIn Java this can look like
this:<неи<неиXTextTablesSupplier xTablesSupplier = (XTextTablesSupplier)
<неиUnoRuntime.queryInterface(XTextTablesSupplier.class,
xTextDocument);<неиXTextTable xTextTable = (XTextTable)
<неиUnoRuntime.queryInterface(XTextTable.class,
<неиxTablesSupplier.getTextTables().getByName("Table1"));<неиXPropertySet
xPropertySet = (XPropertySet)
<неиUnoRuntime.queryInterface(XPropertySet.class,
xTextTable);<неиcom.sun.star.text.TableColumnSeparator[] sep =
(TableColumnSeparator[])
<неиxPropertySet.getPropertyValue("TableColumnSeparators");<неиsep[0].Positi
on = 1000;<неиxPropertySet.setPropertyValue("TableColumnSeparators",
sep);<неи<неиRegards<неи<неиPeter<неи<неи-----------------------------------
----------------------------------<неиTo unsubscribe, e-mail:
api-unsubscr...@openoffice.apache.org<неиFor additional commands, e-mail:
api-h...@openoffice.apache.org<неи<неи


---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org

Reply via email to