From 127210760430478a47fb5336d94ca2848ab2ef0f Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sat, 9 Jul 2011 14:42:37 +0000 Subject: [PATCH] sort CHPX / PAPX / SEPX tables for Word95 files as well git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144680 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hwpf/model/OldCHPBinTable.java | 3 +++ .../src/org/apache/poi/hwpf/model/OldPAPBinTable.java | 3 +++ .../src/org/apache/poi/hwpf/model/OldSectionTable.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java index 1431cff03..089207dfb 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldCHPBinTable.java @@ -17,6 +17,8 @@ package org.apache.poi.hwpf.model; +import java.util.Collections; + import org.apache.poi.poifs.common.POIFSConstants; import org.apache.poi.util.LittleEndian; @@ -62,5 +64,6 @@ public final class OldCHPBinTable extends CHPBinTable _textRuns.add(cfkp.getCHPX(y)); } } + Collections.sort( _textRuns, PropertyNode.StartComparator.instance ); } } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java index 37ec57557..b8b0fc3c2 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldPAPBinTable.java @@ -17,6 +17,8 @@ package org.apache.poi.hwpf.model; +import java.util.Collections; + import org.apache.poi.poifs.common.POIFSConstants; import org.apache.poi.util.LittleEndian; @@ -54,6 +56,7 @@ public final class OldPAPBinTable extends PAPBinTable _paragraphs.add(papx); } } + Collections.sort( _paragraphs, PropertyNode.StartComparator.instance ); } } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java index 8cc0c5b30..db84825e0 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java @@ -17,6 +17,8 @@ package org.apache.poi.hwpf.model; +import java.util.Collections; + import org.apache.poi.util.LittleEndian; /** @@ -66,6 +68,7 @@ public final class OldSectionTable extends SectionTable _sections.add(new SEPX(sed, startAt, endAt, charConv, buf)); } } + Collections.sort( _sections, PropertyNode.StartComparator.instance ); } private static class CharIsBytes implements CharIndexTranslator {