incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 120346] Cannot read property TableName from a table using UNO
Date Mon, 23 Jul 2012 12:05:28 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=120346

--- Comment #3 from Maxim Zinal <MaxZinal@yandex.ru> ---
(In reply to comment #2)
> I do not find a property "TableName".
> 
> You can get the name from ElementNames(<Index>) from TextTables, if you know
> the index of the table or from the property "Name", from the table itself.

This property name is returned via XPropertySet, as the following code
snippet illustrates:

CODE EXAMPLE:
    XTextTablesSupplier tablesSupplier =
        (XTextTablesSupplier)
UnoRuntime.queryInterface(XTextTablesSupplier.class,
        xTemplateComponent);
    XIndexAccess indexedTables = (XIndexAccess) UnoRuntime.queryInterface(
        XIndexAccess.class, tablesSupplier.getTextTables());
    for ( int i=0; i<indexedTables.getCount(); ++i ) {
      log.info("------------- Next table -------------");
      Object table = indexedTables.getByIndex(i);
      XPropertySet xTableProps = (XPropertySet) UnoRuntime.queryInterface(
         XPropertySet.class, table);
      for ( Property p : xTableProps.getPropertySetInfo().getProperties() ) {
        System.out.println("    Property: "+p.Name);
        try {
          System.out.println("    Value: " +
xTableProps.getPropertyValue(p.Name));
        } catch(Throwable x) {
          x.printStackTrace(System.out);
        }
      }
    }

CODE OUTPUT:
------------- Next table -------------
    Property: EndRedline
    Value: Any[Type[void], null]
    Property: TableBorder
    Value: com.sun.star.table.TableBorder@9e29fb
    Property: TextSection
    Value: Any[Type[void], null]
    Property: ChartRowAsLabel
    Value: false
    Property: Width
    Value: 17004
    Property: ShadowFormat
    Value: com.sun.star.table.ShadowFormat@1d64c37
    Property: BackGraphicLocation
    Value: com.sun.star.style.GraphicLocation@25d2b2
    Property: BreakType
    Value: com.sun.star.style.BreakType@12be1bd
    Property: TableColumnSeparators
    Value: [Lcom.sun.star.text.TableColumnSeparator;@1f17e77
    Property: ChartColumnAsLabel
    Value: false
    Property: Split
    Value: true
    Property: PageDescName
    Value: Standard
    Property: StartRedline
    Value: Any[Type[void], null]
    Property: BottomMargin
    Value: 0
    Property: AnchorTypes
    Value: [Lcom.sun.star.text.TextContentAnchorType;@1a5f739
    Property: PageStyleName
    Value: Standard
    Property: PageNumberOffset
    Value: 0
    Property: TextWrap
    Value: com.sun.star.text.WrapTextMode@109fd93
    Property: HeaderRowCount
    Value: 0
    Property: LinkDisplayName
    Value: Таблица1
    Property: RightMargin
    Value: 0
    Property: RepeatHeadline
    Value: false
    Property: BackColor
    Value: -1
    Property: TableName                    <--- The TableName property and it's
exception
com.sun.star.uno.RuntimeException: 
    at
com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:173)
    at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:139)
    at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:334)
    at
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:303)
    at
com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:87)
    at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:636)
    at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:146)
    at
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:128)
    at $Proxy3.getPropertyValue(Unknown Source)
    at ru.pg.asmrp.tests.ooo.BasicTest.testWordTables(BasicTest.java:66)
    at ru.pg.asmrp.tests.ooo.BasicTest.main(BasicTest.java:32)
    Property: KeepTogether
    Value: false
    Property: BackGraphicFilter
    Value: 
    Property: UserDefinedAttributes
    Value: Any[Type[com.sun.star.container.XNameContainer],
[Proxy:12170552,-50aec4cc;gcc3[0];40752e82c67a406586d18d81772935a9,Type[com.sun.star.container.XNameContainer]]]
    Property: WritingMode
    Value: 0
    Property: AnchorType
    Value: com.sun.star.text.TextContentAnchorType@288051
    Property: CollapsingBorders
    Value: true
    Property: TableColumnRelativeSum
    Value: 10000
    Property: BackTransparent
    Value: true
    Property: HoriOrient
    Value: 3
    Property: TopMargin
    Value: 0
    Property: RelativeWidth
    Value: 0
    Property: BackGraphicURL
    Value: 
    Property: TableBorderDistances
    Value: com.sun.star.table.TableBorderDistances@10045eb
    Property: LeftMargin
    Value: 0
    Property: IsWidthRelative
    Value: false

-- 
You are receiving this mail because:
You are the assignee for the bug.
Mime
View raw message