poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1189612 - in /poi/trunk/src/scratchpad/src/org/apache/poi: hssf/converter/ hwpf/converter/
Date Thu, 27 Oct 2011 05:58:55 GMT
Author: sergey
Date: Thu Oct 27 05:58:54 2011
New Revision: 1189612

URL: http://svn.apache.org/viewvc?rev=1189612&view=rev
Log:
ability to extends documents facades

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java?rev=1189612&r1=1189611&r2=1189612&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java Thu
Oct 27 05:58:54 2011
@@ -137,6 +137,11 @@ public class ExcelToFoConverter extends 
         this.foDocumentFacade = new FoDocumentFacade( document );
     }
 
+    public ExcelToFoConverter( FoDocumentFacade foDocumentFacade )
+    {
+        this.foDocumentFacade = foDocumentFacade;
+    }
+
     protected String createPageMaster( float tableWidthIn, String pageMasterName )
     {
         final float paperHeightIn;

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java?rev=1189612&r1=1189611&r2=1189612&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java Thu
Oct 27 05:58:54 2011
@@ -133,8 +133,6 @@ public class ExcelToHtmlConverter extend
 
     private String cssClassPrefixTable = "t";
 
-    private final String cssClassTable;
-
     private Map<Short, String> excelStyleToClass = new LinkedHashMap<Short, String>();
 
     private final HtmlDocumentFacade htmlDocumentFacade;
@@ -144,9 +142,11 @@ public class ExcelToHtmlConverter extend
     public ExcelToHtmlConverter( Document doc )
     {
         htmlDocumentFacade = new HtmlDocumentFacade( doc );
-        cssClassTable = htmlDocumentFacade.getOrCreateCssClass(
-                cssClassPrefixTable,
-                "border-collapse:collapse;border-spacing:0;" );
+    }
+
+    public ExcelToHtmlConverter( HtmlDocumentFacade htmlDocumentFacade )
+    {
+        this.htmlDocumentFacade = htmlDocumentFacade;
     }
 
     protected String buildStyle( HSSFWorkbook workbook, HSSFCellStyle cellStyle )
@@ -643,7 +643,8 @@ public class ExcelToHtmlConverter extend
             return;
 
         Element table = htmlDocumentFacade.createTable();
-        table.setAttribute( "class", cssClassTable );
+        htmlDocumentFacade.addStyleClass( table, cssClassPrefixTable,
+                "border-collapse:collapse;border-spacing:0;" );
 
         Element tableBody = htmlDocumentFacade.createTableBody();
 

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java?rev=1189612&r1=1189611&r2=1189612&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java Thu
Oct 27 05:58:54 2011
@@ -138,6 +138,11 @@ public class WordToFoConverter extends A
         this.foDocumentFacade = new FoDocumentFacade( document );
     }
 
+    public WordToFoConverter( FoDocumentFacade foDocumentFacade )
+    {
+        this.foDocumentFacade = foDocumentFacade;
+    }
+
     protected Element createNoteInline( String noteIndexText )
     {
         Element inline = foDocumentFacade.createInline();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java?rev=1189612&r1=1189611&r2=1189612&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java Thu
Oct 27 05:58:54 2011
@@ -180,6 +180,11 @@ public class WordToHtmlConverter extends
         this.htmlDocumentFacade = new HtmlDocumentFacade( document );
     }
 
+    public WordToHtmlConverter( HtmlDocumentFacade htmlDocumentFacade )
+    {
+        this.htmlDocumentFacade = htmlDocumentFacade;
+    }
+
     @Override
     protected void afterProcess()
     {
@@ -313,16 +318,6 @@ public class WordToHtmlConverter extends
                     basicLink );
     }
 
-    @Override
-    protected void processImageWithoutPicturesManager( Element currentBlock,
-            boolean inlined, Picture picture )
-    {
-        // no default implementation -- skip
-        currentBlock.appendChild( htmlDocumentFacade.document
-                .createComment( "Image link to '"
-                        + picture.suggestFullFileName() + "' can be here" ) );
-    }
-
     protected void processImage( Element currentBlock, boolean inlined,
             Picture picture, String imageSourcePath )
     {
@@ -411,6 +406,16 @@ public class WordToHtmlConverter extends
     }
 
     @Override
+    protected void processImageWithoutPicturesManager( Element currentBlock,
+            boolean inlined, Picture picture )
+    {
+        // no default implementation -- skip
+        currentBlock.appendChild( htmlDocumentFacade.document
+                .createComment( "Image link to '"
+                        + picture.suggestFullFileName() + "' can be here" ) );
+    }
+
+    @Override
     protected void processLineBreak( Element block, CharacterRun characterRun )
     {
         block.appendChild( htmlDocumentFacade.createLineBreak() );

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java?rev=1189612&r1=1189611&r2=1189612&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java Thu
Oct 27 05:58:54 2011
@@ -170,6 +170,11 @@ public class WordToTextConverter extends
         this.textDocumentFacade = new TextDocumentFacade( document );
     }
 
+    public WordToTextConverter( TextDocumentFacade textDocumentFacade )
+    {
+        this.textDocumentFacade = textDocumentFacade;
+    }
+
     @Override
     protected void afterProcess()
     {



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


Mime
View raw message