Summary: | [PATCH] getTableArray method can not get 0 pos table | ||
---|---|---|---|
Product: | POI | Reporter: | zhangyu <yu.zhang> |
Component: | XWPF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kosuke_ueki91, lianyining |
Priority: | P2 | Keywords: | PatchAvailable |
Version: | 3.11-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
get*Array methods fix
updated patch with some tests |
Description
zhangyu
2015-01-26 03:07:06 UTC
I noticed that not just this method, other get*Array methods have the same issue. Why nobody has noticed a simple mistake like this? I will try to create a patch for this tomorrow, if nobody has done it already. Created attachment 32412 [details]
get*Array methods fix
Patch added, I think it's ok, it's my first time creating a patch, I used the patch.xml Ant script provided, so it should be fine.
I also added a helper method in org.apache.poi.util.Units to convert pixels to EMUs
Thanks! Any chance of some unit tests to go with this? That'll let us ensure it doesn't accidentally get broken in the future (In reply to Nick Burch from comment #3) > Thanks! > > Any chance of some unit tests to go with this? That'll let us ensure it > doesn't accidentally get broken in the future I can try, but don't promise nothing, it has been a long time since the last unit testing that I did. I'm not so much friend of unit tests, I'm more of printing traces to the command line XD. Of course I'm aware that for large projects like this one unit testing is much better. I will make a try Created attachment 32419 [details]
updated patch with some tests
Ok, I have successfully added some unit tests, however I couldn't test the methods on HeaderFooter and Footnote since I didn't found any easy straight-forward way of creating them, seems like you need to struggle with the internal Xml Beans.
Also, technically it's possible to create nested Tables in a cell, but there isn't any createTable method, hence I couldn't test the getTableArray method of the TableCell
(In reply to Dominik Stadler from comment #6) > Applied via r1734694, thanks for the Patch! Jesus! That took so long! But I'm glad to see that my contribution was useful. As the saying goes "Gut Ding will Weile haben.", or in English "Haste makes waste." ;), or rather only a few people looking at a large pile of bug-reports... |