Bug 47494

Summary: RichText change causes out of bounds exception
Product: POI Reporter: ujjwal b soni <ujjwalbsoni20032003>
Component: HSLFAssignee: POI Developers List <dev>
Severity: major    
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Hardware: HP   
OS: Windows Vista   

Description ujjwal b soni 2009-07-08 00:43:39 UTC
If we do something like... 

richText[k].setRawText(richText[k].getRawText().replace("[SYSDATE2]", "REPLACED_DATE2")); 

We'll get a string out of bounds exception generated from within the setRawText method. eg. 

Problem with slide show String index out of range: 51 
java.lang.StringIndexOutOfBoundsException: String index out of range: 51 
        at java.lang.String.substring(String.java:1765) 
        at org.apache.poi.hslf.usermodel.RichTextRun.getRawText(RichTextRun.java:158) 
        at org.apache.poi.hslf.model.TextRun.changeTextInRichTextRun(TextRun.java:435) 
        at org.apache.poi.hslf.usermodel.RichTextRun.setRawText(RichTextRun.java:174) 
        at com.globoforce.scheduled.App.main(App.java:34)
Comment 1 Andreas Beeker 2015-11-01 19:44:54 UTC

*** This bug has been marked as a duplicate of bug 45088 ***