[Solved] Who can be TextTable's parents?
Posted: Wed Sep 14, 2022 10:53 am
Today, I inserted one TextFrame with TextTable in my text document and another two copies of this.
Now, I want to get each TextTables by its own parents' Supplier.But,I found that I can't do this by TextFrame.When I try to get XTextTablesSupplier through TextFrame's object like this,
code gave me a null return.
I can get all TextTables by XTextDocument object, but I can't identity which TextFrame they are belong to.
So,I want to know how can I identity one TextTable belongs to which TextFrame?
Now, I want to get each TextTables by its own parents' Supplier.But,I found that I can't do this by TextFrame.When I try to get XTextTablesSupplier through TextFrame's object like this,
Code: Select all
com.sun.star.text.xTextFrame = UnoRuntime.queryInterface(
XTextFrame.class, xNameAccess.getByName(ele));
com.sun.star.text.XTextTablesSupplier xTextTablesSupplier = (com.sun.star.text.XTextTablesSupplier)
UnoRuntime.queryInterface( com.sun.star.text.XTextTablesSupplier.class,
xTextFrame );
I can get all TextTables by XTextDocument object, but I can't identity which TextFrame they are belong to.
Code: Select all
com.sun.star.text.XTextDocument myDoc = (com.sun.star.text.XTextDocument)
UnoRuntime.queryInterface(com.sun.star.text.XTextDocument.class,
xComp);
com.sun.star.text.XTextTablesSupplier xTextTablesSupplier = (com.sun.star.text.XTextTablesSupplier)
UnoRuntime.queryInterface( com.sun.star.text.XTextTablesSupplier.class,
myDoc);