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

svn commit: r1144331 - in /poi/trunk/src: documentation/content/xdocs/status.xml examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java java/org/apache/poi/ss/format/CellFormat.java

Author: nick
Date: Fri Jul  8 14:27:21 2011
New Revision: 1144331

URL: http://svn.apache.org/viewvc?rev=1144331&view=rev
Log:
Apply patch from bug #51476 - Correct XSSF cell formatting in HTML export

Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java
    poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.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=1144331&r1=1144330&r2=1144331&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Fri Jul  8 14:27:21 2011
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta4" date="2011-??-??">
+           <action dev="poi-developers" type="fix">51476 - Correct XSSF cell formatting in HTML export</action>
            <action dev="poi-developers" type="add">51486 - XWPF support for adding new footnotes</action>
            <action dev="poi-developers" type="fix">48065 - Problems with save output of HWPF (losing formatting)</action>
            <action dev="poi-developers" type="fix">47563 - Exception when working with table</action>

Modified: poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java?rev=1144331&r1=1144330&r2=1144331&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java Fri Jul  8 14:27:21 2011
@@ -58,7 +58,11 @@ public class XSSFHtmlHelper implements H
         // support it will ignore the rgba specification and stick with the
         // solid color, which is declared first
         out.format("  %s: #%02x%02x%02x;%n", attr, rgb[0], rgb[1], rgb[2]);
+        byte[] argb = color.getARgb();
+        if (argb == null) {
+            return;
+        }
         out.format("  %s: rgba(0x%02x, 0x%02x, 0x%02x, 0x%02x);%n", attr,
-                rgb[0], rgb[1], rgb[2], rgb[3]);
+                argb[3], argb[0], argb[1], argb[2]);
     }
 }
\ No newline at end of file

Modified: poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java?rev=1144331&r1=1144330&r2=1144331&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java Fri Jul  8 14:27:21 2011
@@ -212,7 +212,7 @@ public class CellFormat {
         case Cell.CELL_TYPE_BLANK:
             return apply("");
         case Cell.CELL_TYPE_BOOLEAN:
-            return apply(c.getStringCellValue());
+            return apply(Boolean.toString(c.getBooleanCellValue()));
         case Cell.CELL_TYPE_NUMERIC:
             return apply(c.getNumericCellValue());
         case Cell.CELL_TYPE_STRING:
@@ -254,7 +254,7 @@ public class CellFormat {
         case Cell.CELL_TYPE_BLANK:
             return apply(label, "");
         case Cell.CELL_TYPE_BOOLEAN:
-            return apply(label, c.getStringCellValue());
+            return apply(Boolean.toString(c.getBooleanCellValue()));
         case Cell.CELL_TYPE_NUMERIC:
             return apply(label, c.getNumericCellValue());
         case Cell.CELL_TYPE_STRING:



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