tdf / odftoolkit

Java ODF toolkit project
https://odftoolkit.org/
Apache License 2.0
114 stars 44 forks source link

getTablelist on a .odm File #188

Open TomWeissflog opened 1 year ago

TomWeissflog commented 1 year ago

After updating from Simple Api to ODFDOM the table search doesn't find the underlying tables from the .odf Files anymore. var count = TextDocument.loadDocument("AFile.odm").getTableList().size() was about 28 Tables var count = OdfTextDocument.loadDocument("AFile.odm").getTableList(true).size() is now 2 In which way do i need to adjust my code to get a complete Table List?

svanteschubert commented 1 year ago

I did a quick grep on existing regression tests:

find . -name *.java | xargs grep getTableList

revealed e.g.

odfdom/src/test/java/org/odftoolkit/odfdom/doc/table/TableTest.java

Could you please give this test a try and adopt this test with your test file adding it to odfdom/src/test/resourcestest-input

As the parameter is true in your example it is a recursive search all <table:table> should be found. Otherwise, you might even give the debugger a try! :-)

Thanks in advance for your help! Svante

svanteschubert commented 1 year ago

Aye, it is a master document and other documents are external and referenced from the master document, which are likely not being searched. If you like to add this functionality, you might want to copy/paste it from the Simple API (once added by IBM).

Any pull requests are most welcome! :-)