]> source.dussan.org Git - poi.git/commitdiff
Fixed incorrect encoding of non-breaking space (0xA0) in SXSSF
authorYegor Kozlov <yegor@apache.org>
Fri, 5 Aug 2011 17:27:08 +0000 (17:27 +0000)
committerYegor Kozlov <yegor@apache.org>
Fri, 5 Aug 2011 17:27:08 +0000 (17:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1154323 13f79535-47bb-0310-9956-ffa450edef68

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

index 4bf487c3e2689fea7af633aaf5bb784d08efe732..df691e87213efdb9abae8e4d38355a801ef5fc58 100644 (file)
@@ -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>
index 05dc3ec12e5ba9d94c79f0def58f205417bf562b..d3b62a5b65797cf87d2aa116cd55a629dd89951a 100644 (file)
@@ -1502,7 +1502,7 @@ public class SXSSFSheet implements Sheet, Cloneable
                     {
                         _out.write(chars,last,counter-last);
                     }
-                    _out.write("&nbsp;");
+                    _out.write("&#xa0;");
                     last=counter+1;
                     break;
                 default:
index f3daf4fd084c77c44b0225cd6402353d6dd5b883..1f1f1beccd7e3e7459e71957692f6ed6f253ca4e 100755 (executable)
@@ -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 BaseTestCell {
                     "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());
+
+    }
 }