]> source.dussan.org Git - poi.git/commitdiff
Add test that shows that bug #45877 has already been fixed
authorNick Burch <nick@apache.org>
Sun, 19 Sep 2010 11:52:20 +0000 (11:52 +0000)
committerNick Burch <nick@apache.org>
Sun, 19 Sep 2010 11:52:20 +0000 (11:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@998634 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java
test-data/document/Bug45877.doc [new file with mode: 0644]

index 19e67a46db6e097675dc663d69914de8519f6df5..6a3a12d75ffb61006aee806c66104e9868fca556 100644 (file)
@@ -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 (file)
index 0000000..af2d6ed
Binary files /dev/null and b/test-data/document/Bug45877.doc differ