Bug 50717 - Update of rich text runs causing errors
Summary: Update of rich text runs causing errors
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.7-FINAL
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-03 16:13 UTC by iset2468
Modified: 2015-11-05 00:56 UTC (History)
0 users



Attachments
Code snippet showing code that causes error. (3.21 KB, application/msword)
2011-02-03 16:13 UTC, iset2468
Details

Note You need to log in before you can comment on or make changes to this bug.
Description iset2468 2011-02-03 16:13:58 UTC
Created attachment 26602 [details]
Code snippet showing code that causes error.

When changeTextInRichTextRun(rtRuns[k], updatedText); is called to update the text in a rich text field, the text the following happens:

Scenario 1 (text is the same length as original)
1. POI performs as expected

Scenario 2 (text is updated to be smaller than the original text)
1. Final text in text run (not rich text run) contains the new value plus the end characters from the original text up to the length of the original text
2. The formatting on the entire slide is lost
3. If getText is called on the rich text run, a string index out of bounds error occurs.

Scenario 3 (text is updated to be smaller than the original text)
1. Final text in text run (not in rich text run) contains the truncated new value to the length of the original text
2. The formatting on the entire slide is lost
3. No string index out of bounds error occurs in this case.

Formatting issues only show up when more than 1 rich text run is modified on the same PPT slide line and 1 is modified per scenarios 2 or 3 above.
Comment 1 Andreas Beeker 2015-11-05 00:56:07 UTC
The example is unfortunately incomplete (no ppt attached, not all methods 
defined) and on the other hand the text handling has been rudimentary changed 
... and I guess it now handles your testcase correctly ... so I'm closing this 
for now.

Feel free to reopen the entry, if the trunk version is not working for you.