https://issues.apache.org/bugzilla/show_bug.cgi?id=45686
Summary: Multible calls of TextRun.changeTextInRichTextRun causes
Exception
Product: POI
Version: 3.0
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSLF
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
Created an attachment (id=22479)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=22479)
sample source code
Hi,
I try to update RichTextRun-Objects in a TextRun-Object.
When I call TextRun.changeTextInRichTextRun(RichTextRun[0],"") the first time
everything works fine. But when I call it a second time
TextRun.changeTextInRichTextRun(RichTextRun[1],"Hello") I get the following
Exception:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String
index out of range: 68
at java.lang.String.substring(Unknown Source)
at
org.apache.poi.hslf.usermodel.RichTextRun.getRawText(RichTextRun.java:158)
at
org.apache.poi.hslf.model.TextRun.changeTextInRichTextRun(TextRun.java:435)
at
substitutionClassesForPptParser.SimpleSubstitution.handeSubstitution(SimpleSubstitution.java:99)
at
methodsFromPptParser.ProcessPptDocumet.importPlaceholder(ProcessPptDocumet.java:94)
at Tester.main(Tester.java:16)
I try something like that.
RichTextRun[0] --> "Hello"
RichTextRun[1] --> "World"
RichTextRun[2] --> "POI"
TextRun.changeTextInRichTextRun(RichTextRun[0], "");
TextRun.changeTextInRichTextRun(RichTextRun[1], "Java");
TextRun.changeTextInRichTextRun(RichTextRun[0], "Apache");
I have attached some sample source code
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]