Summary: | Moving cell comment crashes Excel file | ||
---|---|---|---|
Product: | POI | Reporter: | andrei <andrei.astrouski> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 3.7-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
CellCommentTest.xlsx
CellCommentTest.java |
Created attachment 26669 [details]
CellCommentTest.java
Thanks for the test case, it made it much quicker to investigate I'm rather confused by this one, but it's either a bug in xmlbeans, or we're doing something too odd in our processing of the vml diagram part. However, by adding a .toString() call in after the update, it seems to make xmlbeans re-compute whatever was broken. I'm sure there should be a better solution, but this seems to work fine as a workaround... Test and workaround added in r1072022. That is really great I have find the right answer hve a look on to http://trollingmotorbatteryguides.com/deep-cycle-battery/ |
Created attachment 26668 [details] CellCommentTest.xlsx Steps: 1. Create Excel file. 2. Add cell comment. 3. Process with POI. Get our created cell comment and try to set to another cell. XSSFCell cell = row.getCell(0); XSSFComment comment = cell.getCellComment(); XSSFCell cellWithoutComment = row.getCell(1); cellWithoutComment.setCellComment(comment); 4. Try to save changes FileOutputStream out = new FileOutputStream(testFilePath); wb.write(out); out.close(); Actual result: NPE appears, file size = 0 bytes Expected: comment moved successfull (in 3.6 it works) See attachments to test