From 4e2ea4d4c44bdd849aed18bd688946cd680f74a5 Mon Sep 17 00:00:00 2001 From: Said Ryan Ackley Date: Sun, 29 Jun 2003 14:19:23 +0000 Subject: [PATCH] latest updates git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353178 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hwpf/model/hdftypes/PAPBinTable.java | 5 +++++ .../poi/hwpf/model/hdftypes/PAPFormattedDiskPage.java | 3 ++- .../poi/hwpf/model/hdftypes/ParagraphHeight.java | 11 +++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPBinTable.java index 882266237..92f954cbf 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPBinTable.java @@ -93,6 +93,11 @@ public class PAPBinTable } } + public ArrayList getParagraphs() + { + return _paragraphs; + } + public void writeTo(HWPFFileSystem sys, int fcMin) throws IOException { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPFormattedDiskPage.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPFormattedDiskPage.java index b4e1a35c2..2890bc085 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPFormattedDiskPage.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/PAPFormattedDiskPage.java @@ -204,6 +204,7 @@ public class PAPFormattedDiskPage extends FormattedDiskPage byte[] grpprl = papx.getGrpprl(); grpprlOffset -= (grpprl.length + (2 - grpprl.length % 2)); + grpprlOffset -= (grpprlOffset % 2); LittleEndian.putInt(buf, fcOffset, papx.getStart() + fcMin); buf[bxOffset] = (byte)(grpprlOffset/2); System.arraycopy(phe, 0, buf, bxOffset + 1, phe.length); @@ -233,7 +234,7 @@ public class PAPFormattedDiskPage extends FormattedDiskPage private ParagraphHeight getParagraphHeight(int index) { - int pheOffset = 1 + (2 * LittleEndian.getUnsignedByte(_fkp, _offset + (((_crun + 1) * 4) + (index * 13)))); + int pheOffset = 1 + (((_crun + 1) * 4) + (index * 13)); ParagraphHeight phe = new ParagraphHeight(_fkp, pheOffset); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/ParagraphHeight.java b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/ParagraphHeight.java index c35cfd30a..2177007f5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/ParagraphHeight.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/ParagraphHeight.java @@ -71,8 +71,7 @@ public class ParagraphHeight private BitField clMac = new BitField(0xff00); private short reserved; private int dxaCol; - private int dymLine; - private int dymHeight; + private int dymLineOrHeight; public ParagraphHeight(byte[] buf, int offset) { @@ -82,9 +81,7 @@ public class ParagraphHeight offset += LittleEndian.SHORT_SIZE; dxaCol = LittleEndian.getInt(buf, offset); offset += LittleEndian.INT_SIZE; - dymLine = LittleEndian.getInt(buf, offset); - offset += LittleEndian.INT_SIZE; - dymHeight = LittleEndian.getInt(buf, offset); + dymLineOrHeight = LittleEndian.getInt(buf, offset); } public void write(OutputStream out) @@ -103,9 +100,7 @@ public class ParagraphHeight offset += LittleEndian.SHORT_SIZE; LittleEndian.putInt(buf, offset, dxaCol); offset += LittleEndian.INT_SIZE; - LittleEndian.putInt(buf, offset, dymLine); - offset += LittleEndian.INT_SIZE; - LittleEndian.putInt(buf, offset, dymHeight); + LittleEndian.putInt(buf, offset, dymLineOrHeight); return buf; }