]> source.dussan.org Git - poi.git/commitdiff
Fix the footnote doubling, and then enable the rest of the SDT tests from Tim Alliso...
authorNick Burch <nick@apache.org>
Tue, 18 Jun 2013 23:39:31 +0000 (23:39 +0000)
committerNick Burch <nick@apache.org>
Tue, 18 Jun 2013 23:39:31 +0000 (23:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1494379 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFSDT.java

index e5371b9804627f475651adfa046d73f9674912cd..406c670c0f951c1c91b1bc573beecedd2fbb1436 100644 (file)
@@ -237,11 +237,6 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
             if (relation.equals(XWPFRelation.FOOTNOTE.getRelation())) {
                 this.footnotes = (XWPFFootnotes)p;
                 this.footnotes.onDocumentRead();
-                // Warning - this apparently doubles footnotes - see bug #????
-                FootnotesDocument footnotesDocument = FootnotesDocument.Factory.parse(p.getPackagePart().getInputStream());
-                for(CTFtnEdn ctFtnEdn : footnotesDocument.getFootnotes().getFootnoteList()) {
-                    footnotes.addFootnote(ctFtnEdn);
-                }
             } else if (relation.equals(XWPFRelation.ENDNOTE.getRelation())){
                 EndnotesDocument endnotesDocument = EndnotesDocument.Factory.parse(p.getPackagePart().getInputStream());
 
index 5a25e9e2c21b1cb367531ceae1d848cf6ce7a62b..2359beac2e46f100d64799d4c9dbadc2fde2e8e6 100644 (file)
@@ -43,8 +43,7 @@ public final class TestXWPFSDT extends TestCase {
                 break;
             }
         }
-        // TODO Fix footnotes issues then enable
-//        assertEquals("controls size", 12, sdts.size());
+        assertEquals("controls size", 12, sdts.size());
 
         assertEquals("tag", "MyTag", tag);
         assertEquals("title", "MyTitle", title);
@@ -70,8 +69,6 @@ public final class TestXWPFSDT extends TestCase {
         XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("Bug54849.docx");
         List<XWPFSDT> sdts = extractAllSDTs(doc);
 
-        // TODO Fix footnotes issue
-/*
         assertEquals("number of sdts", contents.length, sdts.size());
 
         for (int i = 0; i < sdts.size(); i++){//contents.length; i++){
@@ -79,7 +76,6 @@ public final class TestXWPFSDT extends TestCase {
 
             assertEquals(i+ ": " + contents[i], contents[i], sdt.getContent().toString());
         } 
-*/
     }
 
     public void testFailureToGetSDTAsCell() throws Exception{