Bug 52745 - XSSFRichTextString append method looses leading/trailing spaces
Summary: XSSFRichTextString append method looses leading/trailing spaces
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.8-dev
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-23 11:15 UTC by Guerrero
Modified: 2012-02-23 12:08 UTC (History)
0 users



Attachments
Diff for method append on XSSFRichTextString (1.09 KB, patch)
2012-02-23 11:25 UTC, Guerrero
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guerrero 2012-02-23 11:15:51 UTC

    
Comment 1 Guerrero 2012-02-23 11:25:09 UTC
Created attachment 28371 [details]
Diff for method append on XSSFRichTextString
Comment 2 Guerrero 2012-02-23 11:26:01 UTC
In our development we needed to append to a XSSFRichTextString multiple substrings each one with different font, so we used the append method. There was a problem because it removes the leading / trailing spaces and joined words. 

For example:


XSSFRichTextString text = cell.getRichStringCellValue();
text.append("Hello ");
text.append("World!");

Makes "HelloWorld!" 

and

text.append("Hello");
text.append(" World!");

also makes "HelloWorld!" 

We have modified the append method to call preserveSpaces and get "Hello World!"
Comment 3 Yegor Kozlov 2012-02-23 12:08:42 UTC
Applied in r1292759 along with a unit test.

Regards,
Yegor