Bug 47494 - RichText change causes out of bounds exception
Summary: RichText change causes out of bounds exception
Status: RESOLVED DUPLICATE of bug 45088
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: unspecified
Hardware: HP Windows Vista
: P1 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-08 00:43 UTC by ujjwal b soni
Modified: 2015-11-01 19:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***