From 3fcfae722ba83c19ca1465c15b5c394b0959b5ce Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 25 Jan 2008 11:52:39 +0000 Subject: [PATCH] Correctly handle the last paragraph via a fix to TableCell - patch from bug #44292 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@615190 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/changes.xml | 1 + src/documentation/content/xdocs/status.xml | 1 + .../apache/poi/hwpf/usermodel/TableRow.java | 2 +- .../org/apache/poi/hwpf/data/Bug44292.doc | Bin 0 -> 24064 bytes .../poi/hwpf/usermodel/TestProblems.java | 30 ++++++++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/scratchpad/testcases/org/apache/poi/hwpf/data/Bug44292.doc diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 51aeb22461..f11d64ad26 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -36,6 +36,7 @@ + 44292 - Correctly process the last paragraph in a word file 44254 - Avoid some unread byte warnings, and properly understand DVALRecord Add another formula evaluation method, evaluateFormulaCell(cell), which will re-calculate the value for a formula, without affecting the formula itself. 41726 - Fix how we handle signed cell offsets in relative areas and references diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index feabdf76b4..73375a336e 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -33,6 +33,7 @@ + 44292 - Correctly process the last paragraph in a word file 44254 - Avoid some unread byte warnings, and properly understand DVALRecord Add another formula evaluation method, evaluateFormulaCell(cell), which will re-calculate the value for a formula, without affecting the formula itself. 41726 - Fix how we handle signed cell offsets in relative areas and references diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java index ff9cf2b9c8..a88e32360e 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java @@ -58,7 +58,7 @@ public class TableRow p = getParagraph(end); s = p.text(); } - _cells[cellIndex] = new TableCell(start, end, this, levelNum, + _cells[cellIndex] = new TableCell(start, end+1, this, levelNum, _tprops.getRgtc()[cellIndex], _tprops.getRgdxaCenter()[cellIndex], _tprops.getRgdxaCenter()[cellIndex+1]-_tprops.getRgdxaCenter()[cellIndex]); diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/data/Bug44292.doc b/src/scratchpad/testcases/org/apache/poi/hwpf/data/Bug44292.doc new file mode 100644 index 0000000000000000000000000000000000000000..fd7ca6cc3e444b2aea9882c20585676f9dd5fba3 GIT binary patch literal 24064 zcmeHPZH!b`8Gi44?yv(auq;#9mb>iGVhd}jrJ*M3Y}it&l&uRa^iOrzncbQFnqhWI zgCXhG4{RbP+t^l(B$fnYwAHMZ7=M^p($)AwBR}XG{k10gj~{DAB8hT+o^$8S-kF_& zVIkC(^Cr)I&w0=1eeSvE-gD18bK#Gx=Fa?V{a>X@J}rK^=0qgqv0Df~sN*dnTM?%1 zn&UV$e+)p-$cKo5OFuX-onMRuMCMojnio+7R~CW`f2c`hg&Y|^GJIz3nYGGVafk%k zqzk#=-;Gmy!?f0lx4PNY@t38tiJ)t&rK3pNi*#z8 z|4%scUm%_;m0POrM?F5&bGUR1HKOCl|IM&S1_l2W5y>Nd0_AIvUp{}`KV+>CZLg}TKgmwKls!!Li`=NCsZPd!6 z>(lKYE{!9xGe3Frx!-YORHDb-Uy$zQO{YHy9ypW!5c*+gjz5a7KfTP2&zHudj_Y(c z_12HNUR{&shwX4&>hsiEx3A+`>+E6|Pl5c==8D!xZ>{7{Kh_kM}&j>;327 zA5b4mvv-VvP+MlcZ#Uj9+A3_@u74}8{bryWI0)$RaMjzZ1|#F%GNaze9S-B! z_zjVf6q{{}TkGQ1Q-ge7`d%NE;A|{_a4m#i{f)0_b~jeP5|6~zMmr=F$BTHCgf2H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