View | Details | Raw Unified | Return to bug 41015
Collapse All | Expand All

(-)src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java (-1 / +2 lines)
Lines 102-108 Link Here
102
				new TextProp(2, 0x4000, "spaceafter"),
102
				new TextProp(2, 0x4000, "spaceafter"),
103
				new TextProp(2, 0x8000, "para_unknown_4"),
103
				new TextProp(2, 0x8000, "para_unknown_4"),
104
				new TextProp(2, 0x10000, "para_unknown_5"),
104
				new TextProp(2, 0x10000, "para_unknown_5"),
105
				new TextProp(2, 0xA0000, "para_unknown_6")
105
				new TextProp(2, 0xA0000, "para_unknown_6"),
106
				new TextProp(2, 0x200000, "para_unknown_7")
106
	};
107
	};
107
	/** All the different kinds of character properties we might handle */
108
	/** All the different kinds of character properties we might handle */
108
	public static TextProp[] characterTextPropTypes = new TextProp[] {
109
	public static TextProp[] characterTextPropTypes = new TextProp[] {
(-)src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java (+32 lines)
Lines 412-415 Link Here
412
		assertEquals(tpCC.getTextPropList(), ntpCC.getTextPropList());
412
		assertEquals(tpCC.getTextPropList(), ntpCC.getTextPropList());
413
		assertEquals(tpDC.getTextPropList(), ntpDC.getTextPropList());
413
		assertEquals(tpDC.getTextPropList(), ntpDC.getTextPropList());
414
    }
414
    }
415
416
    /**
417
     * Test case for Bug 41015.
418
     *
419
     * In some cases RichTextRun.getText() threw StringIndexOutOfBoundsException because
420
     * of the wrong list of potential paragraph properties defined in StyleTextPropAtom.
421
     *
422
     */
423
    public void testBug41015() throws Exception {
424
        RichTextRun[] rt;
425
426
        SlideShow ppt = new SlideShow(new HSLFSlideShow(System.getProperty("HSLF.testdata.path") + "/bug-41015.ppt"));
427
        Slide sl = ppt.getSlides()[0];
428
        TextRun[] txt = sl.getTextRuns();
429
        assertEquals(2, txt.length);
430
431
        rt = txt[0].getRichTextRuns();
432
        assertEquals(1, rt.length);
433
        assertEquals(0, rt[0].getIndentLevel());
434
        assertEquals("sdfsdfsdf", rt[0].getText());
435
436
        rt = txt[1].getRichTextRuns();
437
        assertEquals(2, rt.length);
438
        assertEquals(0, rt[0].getIndentLevel());
439
        assertEquals("Sdfsdfsdf\n" +
440
                "Dfgdfg\n" +
441
                "Dfgdfgdfg\n", rt[0].getText());
442
        assertEquals(1, rt[1].getIndentLevel());
443
        assertEquals("Sdfsdfs\n" +
444
                "Sdfsdf\n", rt[1].getText());
445
    }
446
415
}
447
}

Return to bug 41015