]> source.dussan.org Git - poi.git/commitdiff
fix loosed formatting to endnotes and footnotes in Word-to-HTML and Word-to-FO converters
authorSergey Vladimirov <sergey@apache.org>
Thu, 21 Jul 2011 03:34:56 +0000 (03:34 +0000)
committerSergey Vladimirov <sergey@apache.org>
Thu, 21 Jul 2011 03:34:56 +0000 (03:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1149022 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java
src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java

index 0c4d31e005438f47a3a8e3d2796ae55dc0ee69a9..c9873d7c7d07b164ac780ceaf8d07e2fb85be044 100644 (file)
@@ -284,7 +284,17 @@ public class WordToFoConverter extends AbstractWordConverter
         backwardLink.appendChild( createNoteInline( textIndex + " " ) );
         backwardLink.setAttribute( "id", forwardLinkName );
         endnote.appendChild( backwardLink );
-        processCharacters( doc, Integer.MIN_VALUE, endnoteTextRange, endnote );
+
+        blocksProperies.push( new BlockProperies( "", -1, false, false ) );
+        try
+        {
+            processCharacters( doc, Integer.MIN_VALUE, endnoteTextRange,
+                    endnote );
+        }
+        finally
+        {
+            blocksProperies.pop();
+        }
         this.endnotes.add( endnote );
     }
 
@@ -317,8 +327,16 @@ public class WordToFoConverter extends AbstractWordConverter
         footnoteBody.appendChild( footnoteBlock );
         footNote.appendChild( footnoteBody );
 
-        processCharacters( doc, Integer.MIN_VALUE, footnoteTextRange,
-                footnoteBlock );
+        blocksProperies.push( new BlockProperies( "", -1, false, false ) );
+        try
+        {
+            processCharacters( doc, Integer.MIN_VALUE, footnoteTextRange,
+                    footnoteBlock );
+        }
+        finally
+        {
+            blocksProperies.pop();
+        }
     }
 
     protected void processHyperlink( HWPFDocumentCore wordDocument,
index a1129347058395141e2e7413edb4479913b1144d..bd8828085334002357d37f76ca53ad0df5c9d10c 100644 (file)
@@ -437,7 +437,15 @@ public class WordToHtmlConverter extends AbstractWordConverter
         span.setAttribute( "class", type + "notetext" );
         note.appendChild( span );
 
-        processCharacters( doc, Integer.MIN_VALUE, noteTextRange, span );
+        this.blocksProperies.add( new BlockProperies( "", -1 ) );
+        try
+        {
+            processCharacters( doc, Integer.MIN_VALUE, noteTextRange, span );
+        }
+        finally
+        {
+            this.blocksProperies.pop();
+        }
     }
 
     protected void processPageref( HWPFDocumentCore hwpfDocument,
@@ -658,6 +666,12 @@ public class WordToHtmlConverter extends AbstractWordConverter
         }
 
         final Element tableElement = htmlDocumentFacade.createTable();
+        tableElement
+                .setAttribute(
+                        "class",
+                        htmlDocumentFacade.getOrCreateCssClass(
+                                tableElement.getTagName(), "t",
+                                "table-layout:fixed;border-collapse:collapse;border-spacing:0;" ) );
         if ( tableHeader.hasChildNodes() )
         {
             tableElement.appendChild( tableHeader );