From: Nick Burch Date: Sun, 19 Sep 2010 11:52:20 +0000 (+0000) Subject: Add test that shows that bug #45877 has already been fixed X-Git-Tag: REL_3_7_BETA3~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=76a609d1477ec021959e3de6e73ef2153d16a5ff;p=poi.git Add test that shows that bug #45877 has already been fixed git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@998634 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java index 19e67a46db..6a3a12d75f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java @@ -254,6 +254,17 @@ public final class TestProblems extends HWPFTestCase { assertEquals("\n", ext.getHeaderText()); assertEquals("", ext.getFooterText()); } + + /** + * Bug #45877 - problematic PAPX with no parent set + */ + public void testParagraphPAPXNoParent45877() throws Exception { + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug45877.doc"); + assertEquals(17, doc.getRange().numParagraphs()); + + assertEquals("First paragraph\r", doc.getRange().getParagraph(0).text()); + assertEquals("After Crashing Part\r", doc.getRange().getParagraph(13).text()); + } /** * Bug #48245 - don't include the text from the diff --git a/test-data/document/Bug45877.doc b/test-data/document/Bug45877.doc new file mode 100644 index 0000000000..af2d6eda14 Binary files /dev/null and b/test-data/document/Bug45877.doc differ