<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" -->
// 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());
}
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(
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());
}
/**