poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From talli...@apache.org
Subject svn commit: r1847263 - in /poi/trunk: src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java test-data/document/60316.docx test-data/document/60316b.dotx
Date Fri, 23 Nov 2018 13:32:22 GMT
Author: tallison
Date: Fri Nov 23 13:32:22 2018
New Revision: 1847263

URL: http://svn.apache.org/viewvc?rev=1847263&view=rev
Log:
bug 60316 -- skip the glossary document, not the template document.

Added:
    poi/trunk/test-data/document/60316.docx   (with props)
    poi/trunk/test-data/document/60316b.dotx   (with props)
Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java?rev=1847263&r1=1847262&r2=1847263&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/ooxml/POIXMLDocumentPart.java Fri Nov 23 13:32:22
2018
@@ -615,7 +615,7 @@ public class POIXMLDocumentPart {
     protected void read(POIXMLFactory factory, Map<PackagePart, POIXMLDocumentPart>
context) throws OpenXML4JException {
         PackagePart pp = getPackagePart();
 
-        if (pp.getContentType().equals(XWPFRelation.TEMPLATE.getContentType())) {
+        if (pp.getContentType().equals(XWPFRelation.GLOSSARY_DOCUMENT.getContentType()))
{
             logger.log(POILogger.WARN,
                     "POI does not currently support template.main+xml (glossary) parts. 
" +
                     "Skipping this part for now.");

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java?rev=1847263&r1=1847262&r2=1847263&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/extractor/TestXWPFWordExtractor.java
Fri Nov 23 13:32:22 2018
@@ -452,4 +452,12 @@ public class TestXWPFWordExtractor exten
         //once we add processing for this, we can change this to contains
         assertNotContained(txt, "table rows");
     }
+
+    public void testPartsInTemplate() throws IOException {
+        XWPFDocument doc = XWPFTestDataSamples.openSampleDocument("60316b.dotx");
+        XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
+        String txt = extractor.getText();
+        assertContains(txt, "header 2");
+        assertContains(txt, "footer 1");
+    }
 }

Added: poi/trunk/test-data/document/60316.docx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/document/60316.docx?rev=1847263&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/document/60316.docx
------------------------------------------------------------------------------
--- svn:mime-type (added)
+++ svn:mime-type Fri Nov 23 13:32:22 2018
@@ -0,0 +1 @@
+application/vnd.openxmlformats-officedocument.wordprocessingml.document

Added: poi/trunk/test-data/document/60316b.dotx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/document/60316b.dotx?rev=1847263&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/document/60316b.dotx
------------------------------------------------------------------------------
--- svn:mime-type (added)
+++ svn:mime-type Fri Nov 23 13:32:22 2018
@@ -0,0 +1 @@
+application/vnd.openxmlformats-officedocument.wordprocessingml.template



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


Mime
View raw message