aboutsummaryrefslogtreecommitdiffstats
path: root/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2006-11-28 15:34:20 +0000
committerNick Burch <nick@apache.org>2006-11-28 15:34:20 +0000
commit49fb78cc39752ce094869b5d27e1708cbf6adb0c (patch)
tree77ba1c807b87009b24b02d2a89ca17576eb3e1ee /src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
parentdf184c3be7b832fa257b38f20759c9179afaeb75 (diff)
downloadpoi-49fb78cc39752ce094869b5d27e1708cbf6adb0c.tar.gz
poi-49fb78cc39752ce094869b5d27e1708cbf6adb0c.zip
Fix for bug 41015 - add in another paragraph property
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@480093 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java')
-rw-r--r--src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
index c35a6a0c6a..7fddde6228 100644
--- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
+++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
@@ -412,4 +412,36 @@ public class TestTextRun extends TestCase {
assertEquals(tpCC.getTextPropList(), ntpCC.getTextPropList());
assertEquals(tpDC.getTextPropList(), ntpDC.getTextPropList());
}
+
+
+ /**
+ * Test case for Bug 41015.
+ *
+ * In some cases RichTextRun.getText() threw StringIndexOutOfBoundsException because
+ * of the wrong list of potential paragraph properties defined in StyleTextPropAtom.
+ *
+ */
+ public void testBug41015() throws Exception {
+ RichTextRun[] rt;
+
+ SlideShow ppt = new SlideShow(new HSLFSlideShow(System.getProperty("HSLF.testdata.path") + "/bug-41015.ppt"));
+ Slide sl = ppt.getSlides()[0];
+ TextRun[] txt = sl.getTextRuns();
+ assertEquals(2, txt.length);
+
+ rt = txt[0].getRichTextRuns();
+ assertEquals(1, rt.length);
+ assertEquals(0, rt[0].getIndentLevel());
+ assertEquals("sdfsdfsdf", rt[0].getText());
+
+ rt = txt[1].getRichTextRuns();
+ assertEquals(2, rt.length);
+ assertEquals(0, rt[0].getIndentLevel());
+ assertEquals("Sdfsdfsdf\n" +
+ "Dfgdfg\n" +
+ "Dfgdfgdfg\n", rt[0].getText());
+ assertEquals(1, rt[1].getIndentLevel());
+ assertEquals("Sdfsdfs\n" +
+ "Sdfsdf\n", rt[1].getText());
+ }
}