poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1722433 - in /poi/trunk/src: integrationtest/org/apache/poi/ ooxml/java/org/apache/poi/openxml4j/opc/ ooxml/java/org/apache/poi/openxml4j/opc/internal/ ooxml/testcases/org/apache/poi/xssf/usermodel/
Date Thu, 31 Dec 2015 09:56:34 GMT
Author: centic
Date: Thu Dec 31 09:56:33 2015
New Revision: 1722433

URL: http://svn.apache.org/viewvc?rev=1722433&view=rev
Log:
Fix bug 58760: non-standard namespace-key breaks parsing XLSX files

Modified:
    poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

Modified: poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java?rev=1722433&r1=1722432&r2=1722433&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java Thu Dec 31 09:56:33 2015
@@ -259,9 +259,6 @@ public class TestAllFiles {
         // non-TNEF files
         EXPECTED_FAILURES.add("ddf/Container.dat");
         EXPECTED_FAILURES.add("ddf/47143.dat");
-        
-        // will be fixed as part of bug 58760
-        EXPECTED_FAILURES.add("spreadsheet/58760.xlsx");
     }
 
     private static final Set<String> IGNORED = new HashSet<String>();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java?rev=1722433&r1=1722432&r2=1722433&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java
Thu Dec 31 09:56:33 2015
@@ -320,7 +320,7 @@ public final class PackageRelationshipCo
             // Check OPC compliance M4.1 rule
             boolean fCorePropertiesRelationship = false;
 
-            NodeList nodeList = root.getElementsByTagName(PackageRelationship.RELATIONSHIP_TAG_NAME);
+            NodeList nodeList = root.getElementsByTagNameNS(PackageNamespaces.RELATIONSHIPS,
PackageRelationship.RELATIONSHIP_TAG_NAME);
             int nodeCount = nodeList.getLength();
             for (int i = 0; i < nodeCount; i++) {
                 Element element = (Element)nodeList.item(i);

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java?rev=1722433&r1=1722432&r2=1722433&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
Thu Dec 31 09:56:33 2015
@@ -377,7 +377,7 @@ public abstract class ContentTypeManager
 			Document xmlContentTypetDoc = DocumentHelper.readDocument(in);
 
 			// Default content types
-			NodeList defaultTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagName(DEFAULT_TAG_NAME);
+			NodeList defaultTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagNameNS(TYPES_NAMESPACE_URI,
DEFAULT_TAG_NAME);
 			int defaultTypeCount = defaultTypes.getLength();
 			for (int i = 0; i < defaultTypeCount; i++) {
                 Element element = (Element) defaultTypes.item(i);
@@ -387,7 +387,7 @@ public abstract class ContentTypeManager
 			}
 
 			// Overriden content types
-            NodeList overrideTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagName(OVERRIDE_TAG_NAME);
+            NodeList overrideTypes = xmlContentTypetDoc.getDocumentElement().getElementsByTagNameNS(TYPES_NAMESPACE_URI,
OVERRIDE_TAG_NAME);
             int overrideTypeCount = overrideTypes.getLength();
             for (int i = 0; i < overrideTypeCount; i++) {
 				Element element = (Element) overrideTypes.item(i);

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1722433&r1=1722432&r2=1722433&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Thu Dec
31 09:56:33 2015
@@ -2879,7 +2879,6 @@ public final class TestXSSFBugs extends
      * ! Rule: Package require content types when retrieving a part from a package. [M.1.14]
      */
     @Test
-    @Ignore
     public void test58760() throws Exception {
         Workbook wb = XSSFTestDataSamples.openSampleWorkbook("58760.xlsx");
         assertEquals(1, wb.getNumberOfSheets());



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


Mime
View raw message