mirror of
https://github.com/apache/poi.git
synced 2025-02-20 17:06:47 +00:00
add failing regression test files
fix ooxml-lite packaging fix PP97 dual storage file handling in extractor git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884962 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b231366fb6
commit
f7c50cfbe3
23
build.xml
23
build.xml
@ -1753,16 +1753,23 @@ under the License.
|
||||
</modulepath>
|
||||
</javac>
|
||||
|
||||
<copy file="${ooxml.lite.report}.clazz" tofile="${ooxml.lite.report}.clazz1" overwrite="true">
|
||||
<filterchain>
|
||||
<sortfilter/>
|
||||
<suffixlines suffix="$*.class"/>
|
||||
</filterchain>
|
||||
</copy>
|
||||
|
||||
<copy file="${ooxml.lite.report}.clazz" tofile="${ooxml.lite.report}.clazz2" overwrite="true">
|
||||
<filterchain>
|
||||
<tokenfilter>
|
||||
<replaceregex pattern="(.*)" replace="\1.class${line.separator}\1$*.class "/>
|
||||
</tokenfilter>
|
||||
<sortfilter/>
|
||||
<suffixlines suffix=".class"/>
|
||||
</filterchain>
|
||||
</copy>
|
||||
|
||||
<copy file="${ooxml.lite.report}.xsb" tofile="${ooxml.lite.report}.xsb2" overwrite="true">
|
||||
<filterchain>
|
||||
<sortfilter/>
|
||||
<prefixlines prefix="org/apache/poi/schemas/ooxml/system/ooxml/"/>
|
||||
<suffixlines suffix=".xsb"/>
|
||||
</filterchain>
|
||||
@ -1770,15 +1777,17 @@ under the License.
|
||||
|
||||
<mkdir dir="build/dist/maven/poi-ooxml-lite"/>
|
||||
|
||||
<jar destfile="${ooxml.lite.jar}" duplicate="preserve">
|
||||
<jar destfile="${ooxml.lite.jar}" duplicate="fail">
|
||||
<zipfileset dir="${basedir}/src/multimodule/ooxml-lite/java9" prefix="META-INF/versions/9" excludes="*.java"/>
|
||||
<zipfileset src="${ooxml.xsds.jar}">
|
||||
<patternset includesfile="${ooxml.lite.report}.clazz2">
|
||||
<patternset>
|
||||
<includesfile name="${ooxml.lite.report}.clazz1"/>
|
||||
<includesfile name="${ooxml.lite.report}.clazz2"/>
|
||||
<includesfile name="${ooxml.lite.report}.xsb2"/>
|
||||
<!-- <include name="org/apache/poi/schemas/ooxml/system/ooxml/*.xsb"/>-->
|
||||
<include name="org/apache/poi/schemas/ooxml/element/**/*.xsb"/>
|
||||
</patternset>
|
||||
<patternset includesfile="${ooxml.lite.report}.xsb2"/>
|
||||
</zipfileset>
|
||||
<zipfileset dir="src/multimodule/ooxml-full/java9" prefix="META-INF/versions/9" excludes="*.java"/>
|
||||
<manifest>
|
||||
<attribute name="Multi-Release" value="true"/>
|
||||
<attribute name="Automatic-Module-Name" value="org.apache.poi.ooxml.schemas"/>
|
||||
|
@ -24,6 +24,7 @@ import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
@ -477,7 +478,7 @@ public class ExcelComparator {
|
||||
|
||||
String col1 = getCellFillBackground(loc1);
|
||||
String col2 = getCellFillBackground(loc2);
|
||||
if (!col1.equals(col2)) {
|
||||
if (!Objects.equals(col1, col2)) {
|
||||
addMessage(loc1, loc2, "Cell Fill Color does not Match ::", col1, col2);
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,9 @@ open module org.apache.poi.ooxml.schemas {
|
||||
// see https://bugs.openjdk.java.net/browse/JDK-8240847
|
||||
requires transitive org.apache.xmlbeans;
|
||||
requires java.xml;
|
||||
|
||||
exports org.apache.poi.schemas.ooxml.system.ooxml;
|
||||
|
||||
exports com.microsoft.schemas.compatibility;
|
||||
exports com.microsoft.schemas.office.excel;
|
||||
exports com.microsoft.schemas.office.office;
|
||||
|
Binary file not shown.
@ -23,6 +23,8 @@ open module org.apache.poi.ooxml.schemas {
|
||||
requires java.xml;
|
||||
|
||||
|
||||
|
||||
|
||||
exports com.microsoft.schemas.compatibility;
|
||||
exports com.microsoft.schemas.office.excel;
|
||||
exports com.microsoft.schemas.office.office;
|
||||
@ -40,6 +42,7 @@ open module org.apache.poi.ooxml.schemas {
|
||||
exports org.openxmlformats.schemas.officeDocument.x2006.customProperties;
|
||||
exports org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes;
|
||||
exports org.openxmlformats.schemas.officeDocument.x2006.extendedProperties;
|
||||
exports org.openxmlformats.schemas.officeDocument.x2006.math;
|
||||
exports org.openxmlformats.schemas.officeDocument.x2006.relationships;
|
||||
exports org.openxmlformats.schemas.officeDocument.x2006.sharedTypes;
|
||||
exports org.openxmlformats.schemas.presentationml.x2006.main;
|
||||
|
@ -81,6 +81,7 @@ public class TestExtractorFactory {
|
||||
private static final POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
|
||||
private static final File ppt = getFileAndCheck(slTests, "SampleShow.ppt");
|
||||
private static final File pptx = getFileAndCheck(slTests, "SampleShow.pptx");
|
||||
private static final File ppt97 = getFileAndCheck(slTests, "bug56240.ppt");
|
||||
private static final File txt = getFileAndCheck(slTests, "SampleShow.txt");
|
||||
|
||||
private static final POIDataSamples olTests = POIDataSamples.getHSMFInstance();
|
||||
@ -126,6 +127,7 @@ public class TestExtractorFactory {
|
||||
Arguments.of("Word 6", doc6, "Word6Extractor", 20),
|
||||
Arguments.of("Word 95", doc95, "Word6Extractor", 120),
|
||||
Arguments.of("PowerPoint", ppt, "SlideShowExtractor", 120),
|
||||
Arguments.of("PowerPoint 97 Dual", ppt97, "SlideShowExtractor", 120),
|
||||
Arguments.of("Visio", vsd, "VisioTextExtractor", 50),
|
||||
Arguments.of("Publisher", pub, "PublisherTextExtractor", 50),
|
||||
Arguments.of("Outlook msg", msg, "OutlookTextExtractor", 50)
|
||||
|
@ -100,7 +100,7 @@ public class OLE2ScratchpadExtractorFactory implements ExtractorProvider {
|
||||
}
|
||||
}
|
||||
|
||||
if (poifsDir.hasEntry(HSLFSlideShow.POWERPOINT_DOCUMENT)) {
|
||||
if (poifsDir.hasEntry(HSLFSlideShow.POWERPOINT_DOCUMENT) || poifsDir.hasEntry(HSLFSlideShow.PP97_DOCUMENT)) {
|
||||
return new SlideShowExtractor<>((HSLFSlideShow)SlideShowFactory.create(poifsDir));
|
||||
}
|
||||
|
||||
|
@ -78,6 +78,7 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh
|
||||
|
||||
/** Powerpoint document entry/stream name */
|
||||
public static final String POWERPOINT_DOCUMENT = "PowerPoint Document";
|
||||
public static final String PP97_DOCUMENT = "PP97_DUALSTORAGE";
|
||||
public static final String PP95_DOCUMENT = "PP40";
|
||||
|
||||
enum LoadSavePhase {
|
||||
|
@ -19,6 +19,7 @@ package org.apache.poi.hslf.usermodel;
|
||||
|
||||
import static org.apache.poi.hslf.usermodel.HSLFSlideShow.POWERPOINT_DOCUMENT;
|
||||
import static org.apache.poi.hslf.usermodel.HSLFSlideShow.PP95_DOCUMENT;
|
||||
import static org.apache.poi.hslf.usermodel.HSLFSlideShow.PP97_DOCUMENT;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -74,8 +75,6 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
|
||||
//arbitrarily selected; may need to increase
|
||||
private static final int MAX_RECORD_LENGTH = 200_000_000;
|
||||
|
||||
private static final String DUAL_STORAGE_NAME = "PP97_DUALSTORAGE";
|
||||
|
||||
// Holds metadata on where things are in our document
|
||||
private CurrentUserAtom currentUser;
|
||||
|
||||
@ -163,10 +162,10 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
|
||||
|
||||
private static DirectoryNode handleDualStorage(DirectoryNode dir) throws IOException {
|
||||
// when there's a dual storage entry, use it, as the outer document can't be read quite probably ...
|
||||
if (!dir.hasEntry(DUAL_STORAGE_NAME)) {
|
||||
if (!dir.hasEntry(PP97_DOCUMENT)) {
|
||||
return dir;
|
||||
}
|
||||
return (DirectoryNode) dir.getEntry(DUAL_STORAGE_NAME);
|
||||
return (DirectoryNode) dir.getEntry(PP97_DOCUMENT);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -831,7 +830,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
|
||||
// only close the filesystem, if we are based on the root node.
|
||||
// embedded documents/slideshows shouldn't close the parent container
|
||||
if (getDirectory().getParent() == null ||
|
||||
getDirectory().getName().equals(DUAL_STORAGE_NAME)) {
|
||||
PP97_DOCUMENT.equals(getDirectory().getName())) {
|
||||
POIFSFileSystem fs = getDirectory().getFileSystem();
|
||||
if (fs != null) {
|
||||
fs.close();
|
||||
|
BIN
test-data/integration/stress001.docx
Normal file
BIN
test-data/integration/stress001.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress002.xlsx
Normal file
BIN
test-data/integration/stress002.xlsx
Normal file
Binary file not shown.
BIN
test-data/integration/stress003.docx
Normal file
BIN
test-data/integration/stress003.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress004.docx
Normal file
BIN
test-data/integration/stress004.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress005.docx
Normal file
BIN
test-data/integration/stress005.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress006.docx
Normal file
BIN
test-data/integration/stress006.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress007.docx
Normal file
BIN
test-data/integration/stress007.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress008.docx
Normal file
BIN
test-data/integration/stress008.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress009.docx
Normal file
BIN
test-data/integration/stress009.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress010.docx
Normal file
BIN
test-data/integration/stress010.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress011.docx
Normal file
BIN
test-data/integration/stress011.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress012.docx
Normal file
BIN
test-data/integration/stress012.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress013.pptx
Normal file
BIN
test-data/integration/stress013.pptx
Normal file
Binary file not shown.
BIN
test-data/integration/stress014.docx
Normal file
BIN
test-data/integration/stress014.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress015.docx
Normal file
BIN
test-data/integration/stress015.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress016.docx
Normal file
BIN
test-data/integration/stress016.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress017.docx
Normal file
BIN
test-data/integration/stress017.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress018.docx
Normal file
BIN
test-data/integration/stress018.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress019.docx
Normal file
BIN
test-data/integration/stress019.docx
Normal file
Binary file not shown.
BIN
test-data/integration/stress020.xlsx
Normal file
BIN
test-data/integration/stress020.xlsx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user