"/xl/ctrlProps/ctrlProp#.xml",
null
);
-
+
+ public static final XSSFRelation CUSTOM_PROPERTIES = new XSSFRelation(
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty",
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customProperty",
+ "/xl/customProperty#.bin",
+ null
+ );
+
public static final String NS_SPREADSHEETML = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
public static final String NS_DRAWINGML = "http://schemas.openxmlformats.org/drawingml/2006/main";
public static final String NS_CHART = "http://schemas.openxmlformats.org/drawingml/2006/chart";
* <code>http://schemas.openxmlformats.org/officeDocument/2006/relationships/image</code>
* @return registered POIXMLRelation or null if not found
*/
- public static XSSFRelation getInstance(String rel){
+ public static XSSFRelation getInstance(String rel) {
return _table.get(rel);
}
}
package org.apache.poi.xssf;\r
\r
import static org.junit.Assert.assertEquals;\r
+import static org.junit.Assert.assertNotNull;\r
import static org.junit.Assert.fail;\r
\r
import org.apache.poi.hssf.HSSFITestDataProvider;\r
import org.apache.poi.ss.usermodel.BaseTestCloneSheet;\r
+import org.apache.poi.ss.usermodel.Sheet;\r
+import org.apache.poi.ss.usermodel.Workbook;\r
import org.apache.poi.xssf.usermodel.XSSFSheet;\r
import org.apache.poi.xssf.usermodel.XSSFWorkbook;\r
import org.junit.Before;\r
import org.junit.Test;\r
\r
+import java.io.FileOutputStream;\r
+import java.io.IOException;\r
+import java.io.OutputStream;\r
+\r
public class TestXSSFCloneSheet extends BaseTestCloneSheet {\r
public TestXSSFCloneSheet() {\r
super(HSSFITestDataProvider.instance);\r
}\r
assertEquals(1, wb.getNumberOfSheets());\r
}\r
+\r
+ @Test\r
+ public void test60512() throws IOException {\r
+ XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("60512.xlsm");\r
+\r
+ assertEquals(1, wb.getNumberOfSheets());\r
+ Sheet sheet = wb.cloneSheet(0);\r
+ assertNotNull(sheet);\r
+ assertEquals(2, wb.getNumberOfSheets());\r
+\r
+\r
+ Workbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);\r
+ assertNotNull(wbBack);\r
+ wbBack.close();\r
+\r
+ OutputStream str = new FileOutputStream("/tmp/60512.xlsx");\r
+ try {\r
+ wb.write(str);\r
+ } finally {\r
+ str.close();\r
+ }\r
+\r
+ wb.close();\r
+ }\r
}\r