poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1189618 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java
Date Thu, 27 Oct 2011 06:07:12 GMT
Author: sergey
Date: Thu Oct 27 06:07:12 2011
New Revision: 1189618

URL: http://svn.apache.org/viewvc?rev=1189618&view=rev
Log:
ability to change CSS building procedure

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java?rev=1189618&r1=1189617&r2=1189618&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java Thu
Oct 27 06:07:12 2011
@@ -93,6 +93,28 @@ public class HtmlDocumentFacade
         element.setAttribute( "class", newClassValue );
     }
 
+    protected String buildStylesheet(
+            final Map<String, Map<String, String>> prefixToMapOfStyles )
+    {
+        StringBuilder stringBuilder = new StringBuilder();
+        for ( Map<String, String> byPrefix : prefixToMapOfStyles.values() )
+        {
+            for ( Map.Entry<String, String> byStyle : byPrefix.entrySet() )
+            {
+                String style = byStyle.getKey();
+                String className = byStyle.getValue();
+
+                stringBuilder.append( "." );
+                stringBuilder.append( className );
+                stringBuilder.append( "{" );
+                stringBuilder.append( style );
+                stringBuilder.append( "}\n" );
+            }
+        }
+        final String stylesheetText = stringBuilder.toString();
+        return stylesheetText;
+    }
+
     public Element createBlock()
     {
         return document.createElement( "div" );
@@ -255,17 +277,6 @@ public class HtmlDocumentFacade
 
     public void updateStylesheet()
     {
-        StringBuilder stringBuilder = new StringBuilder();
-        for ( Map<String, String> byPrefix : stylesheet.values() )
-        {
-            for ( Map.Entry<String, String> byStyle : byPrefix.entrySet() )
-            {
-                String style = byStyle.getKey();
-                String className = byStyle.getValue();
-
-                stringBuilder.append( "." + className + "{" + style + "}\n" );
-            }
-        }
-        stylesheetElement.setTextContent( stringBuilder.toString() );
+        stylesheetElement.setTextContent( buildStylesheet( stylesheet ) );
     }
 }



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


Mime
View raw message