poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r680564 - in /poi/branches/ooxml: build.xml src/ooxml/java/org/apache/poi/POIXMLDocument.java src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
Date Mon, 28 Jul 2008 23:32:13 GMT
Author: nick
Date: Mon Jul 28 16:32:13 2008
New Revision: 680564

URL: http://svn.apache.org/viewvc?rev=680564&view=rev
Log:
New openxml4j version, and new save/reload test

Modified:
    poi/branches/ooxml/build.xml
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocument.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

Modified: poi/branches/ooxml/build.xml
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/build.xml?rev=680564&r1=680563&r2=680564&view=diff
==============================================================================
--- poi/branches/ooxml/build.xml (original)
+++ poi/branches/ooxml/build.xml Mon Jul 28 16:32:13 2008
@@ -135,8 +135,8 @@
   <property name="ooxml.jar5.dir" location="${ooxml.lib}/jsr173_1.0_api.jar"/>
   <property name="ooxml.jar5.url" value="${repository}/xmlbeans/jars/jsr173_1.0_api.jar"/>
   <!-- No official release of openxml4j yet -->
-  <property name="ooxml.jar6.dir" location="${ooxml.lib}/openxml4j-bin-alpha-080407.jar"/>
-  <property name="ooxml.jar6.url" value="http://people.apache.org/~nick/openxml4j-bin-alpha-080407.jar"/>
+  <property name="ooxml.jar6.dir" location="${ooxml.lib}/openxml4j-bin-beta-080728.jar"/>
+  <property name="ooxml.jar6.url" value="http://people.apache.org/~nick/openxml4j-bin-beta-080728.jar"/>
 
   <!-- See http://www.ecma-international.org/publications/standards/Ecma-376.htm -->
   <!-- "Copy these file(s), free of charge" -->

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocument.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocument.java?rev=680564&r1=680563&r2=680564&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocument.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocument.java Mon Jul 28 16:32:13
2008
@@ -75,6 +75,10 @@
 	        // Get core part
 	        this.corePart = this.pkg.getPart(coreDocRelationship);
 
+	        // Verify it's there
+	        if(corePart == null) {
+	        	throw new IllegalArgumentException("No core part found for this document! Nothing
with " + coreDocRelationship.getRelationshipType() + " present as a relation.");
+	        }
         } catch (OpenXML4JException e) {
             throw new IOException(e.toString());
     	}

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=680564&r1=680563&r2=680564&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
(original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
Mon Jul 28 16:32:13 2008
@@ -20,14 +20,13 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.FileOutputStream;
+
+import junit.framework.TestCase;
 
 import org.openxml4j.opc.Package;
 import org.openxml4j.opc.PackagePart;
 import org.openxml4j.opc.PackagingURIHelper;
 
-import junit.framework.TestCase;
-
 public class TestXSSFBugs extends TestCase {
 	private String getFilePath(String file) {
 		File xml = new File(
@@ -71,6 +70,12 @@
 		assertFalse(wb.getNameAt(2).getCTName().isSetLocalSheetId());
 		assertEquals("SheetC!$A$1", wb.getNameAt(2).getReference());
 		assertEquals("SheetC", wb.getNameAt(2).getSheetName());
+		
+		// Save and re-load, still there
+		Package nPkg = saveAndOpen(wb);
+		XSSFWorkbook nwb = new XSSFWorkbook(nPkg);
+		assertEquals(3, nwb.getNumberOfNames());
+		assertEquals("SheetA!$A$1", nwb.getNameAt(0).getReference());
 	}
 	
 	/**



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


Mime
View raw message