You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2011/08/05 19:27:09 UTC

svn commit: r1154323 - in /poi/trunk/src: documentation/content/xdocs/status.xml ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java ooxml/testcases/org/apache/poi/xssf/usermodel/streaming/TestSXSSFCell.java

Author: yegor
Date: Fri Aug  5 17:27:08 2011
New Revision: 1154323

URL: http://svn.apache.org/viewvc?rev=1154323&view=rev
Log:
Fixed incorrect encoding of non-breaking space (0xA0) in SXSSF

Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/streaming/TestSXSSFCell.java

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=1154323&r1=1154322&r2=1154323&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Fri Aug  5 17:27:08 2011
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta4" date="2011-??-??">
+           <action dev="poi-developers" type="fix">Fixed incorrect encoding of non-breaking space (0xA0) in SXSSF</action>
            <action dev="poi-developers" type="add">Support for conditional formatting in XSSF</action>
            <action dev="poi-developers" type="add">Support isRightToLeft and setRightToLeft on the common spreadsheet Sheet interface, as per existing HSSF support</action>
            <action dev="poi-developers" type="fix">50209 - Fixed evaluation of Subtotals to ignore nested subtotals</action>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java?rev=1154323&r1=1154322&r2=1154323&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java Fri Aug  5 17:27:08 2011
@@ -1502,7 +1502,7 @@ public class SXSSFSheet implements Sheet
                     {
                         _out.write(chars,last,counter-last);
                     }
-                    _out.write("&nbsp;");
+                    _out.write("&#xa0;");
                     last=counter+1;
                     break;
                 default:

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/streaming/TestSXSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/streaming/TestSXSSFCell.java?rev=1154323&r1=1154322&r2=1154323&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/streaming/TestSXSSFCell.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/streaming/TestSXSSFCell.java Fri Aug  5 17:27:08 2011
@@ -19,7 +19,7 @@
 
 package org.apache.poi.xssf.usermodel.streaming;
 
-import org.apache.poi.ss.usermodel.BaseTestCell;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.SXSSFITestDataProvider;
 
 /**
@@ -60,4 +60,18 @@ public class TestSXSSFCell extends BaseT
                     "Only XSSFCells can be evaluated.", e.getMessage());
         }
     }
+
+    public void testXmlEncoding(){
+        Workbook wb = _testDataProvider.createWorkbook();
+        Sheet sh = wb.createSheet();
+        Row row = sh.createRow(0);
+        Cell cell = row.createCell(0);
+        String sval = "<>\t\r\n\u00a0 &\"POI\'\u2122";
+        cell.setCellValue(sval);
+
+        wb = _testDataProvider.writeOutAndReadBack(wb);
+
+        assertEquals(sval, wb.getSheetAt(0).getRow(0).getCell(0).getStringCellValue());
+
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org