Bug 44292 - [PATCH] TableCell skip its last Paragraphs
Summary: [PATCH] TableCell skip its last Paragraphs
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: 3.0-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2008-01-24 08:54 UTC by Jean-Philippe Gagnon
Modified: 2008-09-21 12:31 UTC (History)
1 user (show)

class TableRow patched (3.72 KB, patch)
2008-01-24 08:58 UTC, Jean-Philippe Gagnon
Details | Diff
Test program to demonstrate the bug (2.11 KB, text/plain)
2008-01-24 09:27 UTC, Jean-Philippe Gagnon
test word document (23.50 KB, application/octet-stream)
2008-01-24 09:28 UTC, Jean-Philippe Gagnon

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Philippe Gagnon 2008-01-24 08:54:55 UTC
TableCells created in the TableRow contructor have a paragraph missing. So when
parsing a cell with more than one Paragraph, the last one is skipped.

Fix in TableRow should call TableCell constructor with "end+1" instead of "end"

_cells[cellIndex] = new TableCell(start, end, this, levelNum,                  
Comment 1 Jean-Philippe Gagnon 2008-01-24 08:58:53 UTC
Created attachment 21422 [details]
class TableRow patched

second parameter of the call to the TableCell constructor is replaced with
Comment 2 Nick Burch 2008-01-24 08:59:23 UTC
Thanks for this. Any chance you could upload a file that shows the problem, and
post a few lines of code that shows it now works properly (ideally as a unit
test, but otherwise just some consise code that shows it we can generate a unit
test from)
Comment 3 Jean-Philippe Gagnon 2008-01-24 09:27:24 UTC
Created attachment 21423 [details]
Test program  to demonstrate the bug

simple main file to demonstrate the bug, path to the file must be adjusted
Comment 4 Jean-Philippe Gagnon 2008-01-24 09:28:40 UTC
Created attachment 21424 [details]
test word document 

Word document used by the test program TableRowTest.java
Comment 5 Nick Burch 2008-01-25 03:53:01 UTC
Thanks for this fix and test, applied to svn
Comment 6 dnapoletano 2008-06-10 00:20:59 UTC
Even reverting end + 1 with end (fixing bug 45062) table cell content is retrieved correctly: should revert be committed?
Comment 7 Nick Burch 2008-09-21 12:31:50 UTC
Just re-tested against svn trunk, and hwpf behaves properly