mirror of https://github.com/apache/poi.git
bug 60316 -- skip the glossary document, not the template document.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1847263 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
34ef20ac82
commit
8e427c1806
|
@ -615,7 +615,7 @@ public class POIXMLDocumentPart {
|
||||||
protected void read(POIXMLFactory factory, Map<PackagePart, POIXMLDocumentPart> context) throws OpenXML4JException {
|
protected void read(POIXMLFactory factory, Map<PackagePart, POIXMLDocumentPart> context) throws OpenXML4JException {
|
||||||
PackagePart pp = getPackagePart();
|
PackagePart pp = getPackagePart();
|
||||||
|
|
||||||
if (pp.getContentType().equals(XWPFRelation.TEMPLATE.getContentType())) {
|
if (pp.getContentType().equals(XWPFRelation.GLOSSARY_DOCUMENT.getContentType())) {
|
||||||
logger.log(POILogger.WARN,
|
logger.log(POILogger.WARN,
|
||||||
"POI does not currently support template.main+xml (glossary) parts. " +
|
"POI does not currently support template.main+xml (glossary) parts. " +
|
||||||
"Skipping this part for now.");
|
"Skipping this part for now.");
|
||||||
|
|
|
@ -452,4 +452,12 @@ public class TestXWPFWordExtractor extends TestCase {
|
||||||
//once we add processing for this, we can change this to contains
|
//once we add processing for this, we can change this to contains
|
||||||
assertNotContained(txt, "table rows");
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue