poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r480093 - in /jakarta/poi/trunk/src/scratchpad: src/org/apache/poi/hslf/record/StyleTextPropAtom.java testcases/org/apache/poi/hslf/data/bug-41015.ppt testcases/org/apache/poi/hslf/model/TestTextRun.java
Date Tue, 28 Nov 2006 15:34:21 GMT
Author: nick
Date: Tue Nov 28 07:34:20 2006
New Revision: 480093

URL: http://svn.apache.org/viewvc?view=rev&rev=480093
Log:
Fix for bug 41015 - add in another paragraph property

Added:
    jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/bug-41015.ppt   (with
props)
Modified:
    jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java
    jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java

Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java?view=diff&rev=480093&r1=480092&r2=480093
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java
Tue Nov 28 07:34:20 2006
@@ -102,7 +102,8 @@
 				new TextProp(2, 0x4000, "spaceafter"),
 				new TextProp(2, 0x8000, "para_unknown_4"),
 				new TextProp(2, 0x10000, "para_unknown_5"),
-				new TextProp(2, 0xA0000, "para_unknown_6")
+				new TextProp(2, 0xA0000, "para_unknown_6"),
+				new TextProp(2, 0x200000, "para_unknown_7")
 	};
 	/** All the different kinds of character properties we might handle */
 	public static TextProp[] characterTextPropTypes = new TextProp[] {

Added: jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/bug-41015.ppt
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/bug-41015.ppt?view=auto&rev=480093
==============================================================================
Binary file - no diff available.

Propchange: jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/data/bug-41015.ppt
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
URL: http://svn.apache.org/viewvc/jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java?view=diff&rev=480093&r1=480092&r2=480093
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
(original)
+++ jakarta/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
Tue Nov 28 07:34:20 2006
@@ -412,4 +412,36 @@
 		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());
+	}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message