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 882266237a..92f954cbf9 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 b4e1a35c27..2890bc0850 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 c35cfd30a7..2177007f5a 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; }