Summary: | [PATCH] WordDocument Problem: createListTables - Negative Array Size | ||
---|---|---|---|
Product: | POI | Reporter: | Robert Paris <rpjava> |
Component: | HDF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 2.0-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
Proposed patch
[PATCH] A simple test case (new files contained in a .zip) |
Description
Robert Paris
2003-02-19 15:57:19 UTC
I did a bit of research into this problem. From what I can tell, the value (at position 24) of cbGrpprlChpx in LVLF is -1 (on the 4th list in my test case). I do not know if this is a valid value (is it?), but the code does not handle this. So what happens is the code attempts to create: new byte[ -1 ]. To create this exception, I used windows 2000, word 2000 and created a document with a numbered list. It only happens with multi-level lists. Created attachment 5150 [details]
Proposed patch
I uploaded a proposed patch for the problem. I was also experience similar problems with a few of my files. The proposed patch fixed my problem. I think it will fix Robert's also. Might also fix bug 16305. Created attachment 5302 [details]
[PATCH] A simple test case (new files contained in a .zip)
Note that no one will probably commit anything not labeled with PATCH in the subject line (because we query on them ;-) ) Andy, are you planning on comitting this? I'll do it tomorrow if you havent got it by then. guess what? apparently this is the first testcase in hdf!! How do i run testcases in scratchpad???? does {old|new} cent let me do that?????? committed. Nice work. Please verify. There's a problem with the data files used by the test case. The files committed to CVS don't match the files posted in the zip. Each of the files committed to CVS is slightly larger than the corresponding file in the zip. filename size in zip size in CVS -------------------------------------------- empty.doc 19456 19462 simple.doc 19456 19463 simple-list.doc 19456 19467 simple-table.doc 19456 19467 Notice that the file sizes in the zip are a multiple of 512. The file sizes in CVS are not a multiple of 512. This presents all sorts of problems with the RawDataBlock class in org.apache.poi.poifs.storage. Word 2000 is unable to open any of the files committed to CVS. No problem with the files in the zip. I downloaded the zip again and verified it. The files in it are definitely OK. I think you'll need to re-extract the files and re-commit them to CVS. I reopened the bug because the Word docs added to CVS for use by the test cases are not correct. Check the comment from 2003-04-15 14:47 for details. I verified that the attached zip file is correct. The Word docs simply need to be extracted and replaced in CVS. Should be against HWPF if its still a problem |