You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/09/16 16:55:25 UTC

DO NOT REPLY [Bug 49941] New: Applying Font to XSSFRichTextString looses non leading/trailing spaces.

https://issues.apache.org/bugzilla/show_bug.cgi?id=49941

           Summary: Applying Font to XSSFRichTextString looses non
                    leading/trailing spaces.
           Product: POI
           Version: 3.6
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: stich23@hotmail.com


If a create an XSSFRichTextString as follows:

RichTextString text = workbook.getCreationHelper().createRichTextString( "Test
String" ) ;

and apply formatting to the first 4 characters "Test":

text.applyFont( 0 , 4 , FONT ) ;

then the remaning text " String" loses its leading white space when rendered in
Excel.

the generated Open XML sharedStrings.xml contains the following:

- <si>
- <r>
- <rPr>
  <u val="single" /> 
  <sz val="11.0" /> 
  <rFont val="Calibri" /> 
  </rPr>
  <t>Test</t> 
  </r>
- <r>
  <t> String</t> 
  </r>
  </si>

The leading space is present but the XML space preserving attribute needs to be
set as follows:

- <si>
- <r>
- <rPr>
  <u val="single" /> 
  <sz val="11.0" /> 
  <rFont val="Calibri" /> 
  </rPr>
  <t>Test</t> 
  </r>
- <r>
  <t xml:space="preserve"> String</t> 
  </r>
  </si>

This is not currently possible that I can see in the POI libraries unless I am
missing something? If no formatting is applied to the XSSFRichTextString then
the XML preserve space attribute is set but when being split for formatting it
does not seem to be accessible.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 49941] Applying Font to XSSFRichTextString looses non leading/trailing spaces.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49941

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2010-09-16 12:01:24 EDT ---
Fixed, along with unit test, in r997811.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org