A merge of the latest code from Goss Interactive that includes the fixes that we rolled into our latest product release. This has been tested against a series of testcase word documents that were supplied by clients or created specifically in-house. Platforms and formats tested include: Office 97/2k/xp, Mac, OpenOffice. All testcases can now be read correctly. Writing is not totally transparent and still needs some work. From our further testing, previous HWPF write functionality appears to remain unaffected. Files altered: ============== hwpf/model/ListLevel.java ------------------------- - fix for listlevel() - papx and chpx arrays were being copied in the wrong order - added getLevelProperties() hwpf/model/ListTables.java -------------------------- - added getListData() hwpf/model/SectionTable.java ---------------------------- - fixed CPtoFC() to accomodate non-contigous textpieces hwpf/model/TextPiece.java ------------------------- - added CP_start property and accessor used by CPtoFC in model/SectionTable.java hwpf/model/TextPiecetable.java ------------------------------ - fix for constructor to take into account non-contigous textpieces hwpf/sprm/ParagraphSprmUncompressor.java ---------------------------------------- - fix for tabs being read as INTs instead of the SHORTs that they are hwpf/sprm/TableSprmUncompressor ------------------------------- - fix for TC entries not always being present in the Word file hwpf/usermodel/CharacterRun.java -------------------------------- - changed to use updateSprm() rather than addSprm() to match code elsewhere that prevents additional sprms being created if they already exist - added accessors for properties that Word uses when handling embedded objects such as Hyperlinks, Pictures, OleObjects etc hwpf/usermodel/Paragraph.java ----------------------------- - added accessors for Ilfo and Ilvl used by Word for numbered lists hwpf/usermodel/Range.java ------------------------- - fixed text() to correctly return unicode text - fixed findRange() to prevent loop indexes going out of bounds, causing an exception - fixed getTable() to cope with tables that start at the beginning of a section such that they don't get merged with preceeding tables - fixed getTable() to return a table at the correct tablelevel hwpf/usermodel/Table.java ------------------------- - minor code tidy hwpf/usermodel/TableRow.java ---------------------------- - removed constraint requiring levelNum==1 in constructor that doesn't work when dealing with documents that include sections
Created attachment 12182 [details] ListLevel.java, ListTables.java, SectionTable.java, TextPiece.java, TextPiecetable.java, ParagraphSprmUncompressor.java, TableSprmUncompressor.java, CharacterRun.java, Paragraph.java, Range.java, Table.java, TableRow.java
Since you're contribution is fairly large I think it would be preferable to get you to sign a CLA before we commit your changes. Since this is work on behalf of your company it might be best to get them to sign a CLA also. Individual CLA: http://www.apache.org/licenses/cla.txt Company CLA: http://www.apache.org/licenses/cla-corporate.txt Sorry to be a pain about CLA's and things but Apache tries hard to make sure there are no legal issues surrounding the code it receives.
No problem Glen, Goss Interactive Ltd. have alredy signed a CLA which you should have on file. Ryan requested this right at the beginning. That CLA will cover the current patch since it was work carried out when I was working there. I have downloaded the "Individual CLA" and will sign and return it to you ASAP. >Sorry to be a pain... Not at all. Regards, Piers
I've applies this patch. It conflicted with the other patch because they're cumulative rather than incremental. Better to close the original patch and recreate a new one with all changes included. I think I got it all sorted out but please give it a check. Once again... sorry for being so late in getting this committed. There are failing tests in scratchpad so if you could have a look at those that would be great.
Thanks for applying the patch. I'll check it out asap. I'll take a look at the tests too.