From ba0be2ca2db1ae6577370cff3ab4030515b67b5a Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sun, 10 Jul 2011 13:08:11 +0000 Subject: [PATCH] fix Word6/95 test cases: in old format boundaries in SEPX refers to chars, not to bytes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144857 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hwpf/model/OldSectionTable.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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 95ea86a63..348cb0350 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java @@ -74,17 +74,12 @@ public final class OldSectionTable extends SectionTable sepx = new SEPX(sed, startAt, endAt, charConv, buf); } - if ( tpt.isIndexInTable( sepx.getStartBytes(), sepx.getEndBytes() ) ) - { - _sections.add( sepx ); - } - else - { - logger.log( POILogger.WARN, "Section [", sepx.getStartBytes(), - "; ", sepx.getEndBytes(), - ") (bytes) doesn't have corresponding text pieces " - + "and will be skipped" ); - } + /* + * section descriptor in old Word files seems to refer to char + * indexes, not bytes positions. Check Word6.doc for example. - + * sergey + */ + _sections.add( sepx ); } Collections.sort( _sections, PropertyNode.StartComparator.instance ); }