From 7d9e12864a57c2661287a19f42cce0e0967397d5 Mon Sep 17 00:00:00 2001 From: Maxim Valyanskiy Date: Mon, 27 Sep 2010 13:08:57 +0000 Subject: [PATCH] revert previous commit because it causes problems with other old .docs git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1001726 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hwpf/model/OldSectionTable.java | 4 ++-- .../apache/poi/hwpf/extractor/TestWordExtractor.java | 12 +----------- 2 files changed, 3 insertions(+), 13 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 18819c32c9..87218b35e5 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldSectionTable.java @@ -60,8 +60,8 @@ public final class OldSectionTable extends SectionTable // section properties, and we're trying to decode them as if they // were the new ones, we sometimes "need" more data than we have. // As a workaround, have a few extra 0 bytes on the end! - byte[] buf = new byte[sepxSize+4]; - fileOffset += 4; + byte[] buf = new byte[sepxSize+2]; + fileOffset += LittleEndian.SHORT_SIZE; System.arraycopy(documentStream, fileOffset, buf, 0, buf.length); _sections.add(new SEPX(sed, startAt, endAt, charConv, buf)); } diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java b/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java index 690345322b..1ef21db3a5 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordExtractor.java @@ -273,17 +273,7 @@ public final class TestWordExtractor extends TestCase { assertEquals("\r\n", tp[5]); assertEquals("Last (4th) paragraph.\r\n", tp[6]); } - - public void testWord95err() throws Exception { - // Can work with the special one - Word6Extractor w6e = new Word6Extractor( - POIDataSamples.getDocumentInstance().openResourceAsStream("word95err.doc") - ); - String text = w6e.getText(); - - assertTrue(text.contains("subject")); - } - + public void testWord6() throws Exception { // Too old for the default try { -- 2.39.5