diff options
29 files changed, 32 insertions, 14 deletions
@@ -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"/> diff --git a/src/examples/src/org/apache/poi/examples/ss/ExcelComparator.java b/src/examples/src/org/apache/poi/examples/ss/ExcelComparator.java index eb80d9286f..069aef0ebe 100644 --- a/src/examples/src/org/apache/poi/examples/ss/ExcelComparator.java +++ b/src/examples/src/org/apache/poi/examples/ss/ExcelComparator.java @@ -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); } } diff --git a/src/multimodule/ooxml-full/java9/module-info.java b/src/multimodule/ooxml-full/java9/module-info.java index 4587ea5e5d..4600c9082a 100644 --- a/src/multimodule/ooxml-full/java9/module-info.java +++ b/src/multimodule/ooxml-full/java9/module-info.java @@ -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; diff --git a/src/multimodule/ooxml-lite/java9/module-info.class b/src/multimodule/ooxml-lite/java9/module-info.class Binary files differindex f6cd8ef67d..5a1a8d9258 100644 --- a/src/multimodule/ooxml-lite/java9/module-info.class +++ b/src/multimodule/ooxml-lite/java9/module-info.class diff --git a/src/multimodule/ooxml-lite/java9/module-info.java b/src/multimodule/ooxml-lite/java9/module-info.java index 1b22147d88..2559d369d8 100644 --- a/src/multimodule/ooxml-lite/java9/module-info.java +++ b/src/multimodule/ooxml-lite/java9/module-info.java @@ -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; diff --git a/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java b/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java index 9715e49e80..6ea3b2132e 100644 --- a/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java +++ b/src/ooxml/testcases/org/apache/poi/extractor/ooxml/TestExtractorFactory.java @@ -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) diff --git a/src/scratchpad/src/org/apache/poi/extractor/ole2/OLE2ScratchpadExtractorFactory.java b/src/scratchpad/src/org/apache/poi/extractor/ole2/OLE2ScratchpadExtractorFactory.java index dfc09b2f7e..40904fe718 100644 --- a/src/scratchpad/src/org/apache/poi/extractor/ole2/OLE2ScratchpadExtractorFactory.java +++ b/src/scratchpad/src/org/apache/poi/extractor/ole2/OLE2ScratchpadExtractorFactory.java @@ -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)); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java index 63e9b69101..9e8d255798 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java @@ -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 { diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java index 264dcb0b4d..c5a43fff87 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java @@ -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(); diff --git a/test-data/integration/stress001.docx b/test-data/integration/stress001.docx Binary files differnew file mode 100644 index 0000000000..4be44a6002 --- /dev/null +++ b/test-data/integration/stress001.docx diff --git a/test-data/integration/stress002.xlsx b/test-data/integration/stress002.xlsx Binary files differnew file mode 100644 index 0000000000..9428f84c9d --- /dev/null +++ b/test-data/integration/stress002.xlsx diff --git a/test-data/integration/stress003.docx b/test-data/integration/stress003.docx Binary files differnew file mode 100644 index 0000000000..100917bff3 --- /dev/null +++ b/test-data/integration/stress003.docx diff --git a/test-data/integration/stress004.docx b/test-data/integration/stress004.docx Binary files differnew file mode 100644 index 0000000000..8997b02ad5 --- /dev/null +++ b/test-data/integration/stress004.docx diff --git a/test-data/integration/stress005.docx b/test-data/integration/stress005.docx Binary files differnew file mode 100644 index 0000000000..56f9f1afe5 --- /dev/null +++ b/test-data/integration/stress005.docx diff --git a/test-data/integration/stress006.docx b/test-data/integration/stress006.docx Binary files differnew file mode 100644 index 0000000000..765846ec3f --- /dev/null +++ b/test-data/integration/stress006.docx diff --git a/test-data/integration/stress007.docx b/test-data/integration/stress007.docx Binary files differnew file mode 100644 index 0000000000..5eb9df6546 --- /dev/null +++ b/test-data/integration/stress007.docx diff --git a/test-data/integration/stress008.docx b/test-data/integration/stress008.docx Binary files differnew file mode 100644 index 0000000000..6a9c5d3c7d --- /dev/null +++ b/test-data/integration/stress008.docx diff --git a/test-data/integration/stress009.docx b/test-data/integration/stress009.docx Binary files differnew file mode 100644 index 0000000000..f811dd7819 --- /dev/null +++ b/test-data/integration/stress009.docx diff --git a/test-data/integration/stress010.docx b/test-data/integration/stress010.docx Binary files differnew file mode 100644 index 0000000000..5ffdbda231 --- /dev/null +++ b/test-data/integration/stress010.docx diff --git a/test-data/integration/stress011.docx b/test-data/integration/stress011.docx Binary files differnew file mode 100644 index 0000000000..46b098d55a --- /dev/null +++ b/test-data/integration/stress011.docx diff --git a/test-data/integration/stress012.docx b/test-data/integration/stress012.docx Binary files differnew file mode 100644 index 0000000000..7146047f2c --- /dev/null +++ b/test-data/integration/stress012.docx diff --git a/test-data/integration/stress013.pptx b/test-data/integration/stress013.pptx Binary files differnew file mode 100644 index 0000000000..574ba55ed7 --- /dev/null +++ b/test-data/integration/stress013.pptx diff --git a/test-data/integration/stress014.docx b/test-data/integration/stress014.docx Binary files differnew file mode 100644 index 0000000000..32503135d2 --- /dev/null +++ b/test-data/integration/stress014.docx diff --git a/test-data/integration/stress015.docx b/test-data/integration/stress015.docx Binary files differnew file mode 100644 index 0000000000..8853d4851f --- /dev/null +++ b/test-data/integration/stress015.docx diff --git a/test-data/integration/stress016.docx b/test-data/integration/stress016.docx Binary files differnew file mode 100644 index 0000000000..f65f2d074a --- /dev/null +++ b/test-data/integration/stress016.docx diff --git a/test-data/integration/stress017.docx b/test-data/integration/stress017.docx Binary files differnew file mode 100644 index 0000000000..1f39b2cc56 --- /dev/null +++ b/test-data/integration/stress017.docx diff --git a/test-data/integration/stress018.docx b/test-data/integration/stress018.docx Binary files differnew file mode 100644 index 0000000000..10f30e4df9 --- /dev/null +++ b/test-data/integration/stress018.docx diff --git a/test-data/integration/stress019.docx b/test-data/integration/stress019.docx Binary files differnew file mode 100644 index 0000000000..420ad1d11f --- /dev/null +++ b/test-data/integration/stress019.docx diff --git a/test-data/integration/stress020.xlsx b/test-data/integration/stress020.xlsx Binary files differnew file mode 100644 index 0000000000..8ed54cf770 --- /dev/null +++ b/test-data/integration/stress020.xlsx |