You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2015/03/22 22:48:49 UTC

svn commit: r1668486 - /poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java

Author: centic
Date: Sun Mar 22 21:48:48 2015
New Revision: 1668486

URL: http://svn.apache.org/r1668486
Log:
Bug 55386: Fix handling of bold formatting in example application 'ToHtml'

Modified:
    poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java

Modified: poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java?rev=1668486&r1=1668485&r2=1668486&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java Sun Mar 22 21:48:48 2015
@@ -289,7 +289,7 @@ public class ToHtml {
     private void fontStyle(CellStyle style) {
         Font font = wb.getFontAt(style.getFontIndex());
 
-        if (font.getBoldweight() >= HSSFFont.BOLDWEIGHT_NORMAL)
+        if (font.getBoldweight() >= HSSFFont.BOLDWEIGHT_BOLD)
             out.format("  font-weight: bold;%n");
         if (font.getItalic())
             out.format("  font-style: italic;%n");
@@ -309,8 +309,12 @@ public class ToHtml {
             style = wb.getCellStyleAt((short) 0);
         StringBuilder sb = new StringBuilder();
         Formatter fmt = new Formatter(sb);
-        fmt.format("style_%02x", style.getIndex());
-        return fmt.toString();
+        try {
+            fmt.format("style_%02x", style.getIndex());
+            return fmt.toString();
+        } finally {
+            fmt.close();
+        }
     }
 
     private <K> void styleOut(String attr, K key, Map<K, String> mapping) {



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