Revert set of inadvertedly committed files/changes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1737029 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f5332a3a40
commit
992adb9c16
@ -18,9 +18,9 @@
|
|||||||
<classpathentry kind="lib" path="lib/ant-1.9.4.jar"/>
|
<classpathentry kind="lib" path="lib/ant-1.9.4.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/ant-launcher-1.9.4.jar"/>
|
<classpathentry kind="lib" path="lib/ant-launcher-1.9.4.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
|
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
|
||||||
<classpathentry kind="lib" path="ooxml-lib/xmlbeans-2.6.0.jar" sourcepath="C:/devtools/source/xmlbeans"/>
|
<classpathentry kind="lib" path="ooxml-lib/xmlbeans-2.6.0.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar" sourcepath="/commons-dost/libsrc/hamcrest-all-1.3-sources.jar"/>
|
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/junit-4.12.jar" sourcepath="/commons-dost/libsrc/junit-4.12-sources.jar"/>
|
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
|
||||||
<classpathentry kind="lib" path="ooxml-lib/curvesapi-1.03.jar"/>
|
<classpathentry kind="lib" path="ooxml-lib/curvesapi-1.03.jar"/>
|
||||||
<classpathentry kind="lib" path="ooxml-lib/ooxml-schemas-1.3.jar" sourcepath="ooxml-lib/ooxml-schemas-1.3-sources.jar"/>
|
<classpathentry kind="lib" path="ooxml-lib/ooxml-schemas-1.3.jar" sourcepath="ooxml-lib/ooxml-schemas-1.3-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="ooxml-lib/ooxml-security-1.1.jar" sourcepath="ooxml-lib/ooxml-security-1.1-sources.jar"/>
|
<classpathentry kind="lib" path="ooxml-lib/ooxml-security-1.1.jar" sourcepath="ooxml-lib/ooxml-security-1.1-sources.jar"/>
|
||||||
@ -31,5 +31,5 @@
|
|||||||
<classpathentry kind="lib" path="compile-lib/xmlsec-2.0.6.jar"/>
|
<classpathentry kind="lib" path="compile-lib/xmlsec-2.0.6.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
|
<classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
|
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="build/eclipse"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
|
||||||
<listEntry value="/Apache POI/src/ooxml/java/org/apache/poi/util/OOXMLLite.java"/>
|
|
||||||
</listAttribute>
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
|
||||||
<listEntry value="1"/>
|
|
||||||
</listAttribute>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK16"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.poi.util.OOXMLLite"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-ooxml build/ooxml-lite-merged/ooxml-lite-merged.jar -test build/ooxml-test-classes -dest build/ooxml-lite-classes"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Apache POI"/>
|
|
||||||
</launchConfiguration>
|
|
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
|
||||||
<listEntry value="/ApachePOI/src/ooxml/java/org/apache/poi/dev/OOXMLPrettyPrint.java"/>
|
|
||||||
</listAttribute>
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
|
||||||
<listEntry value="1"/>
|
|
||||||
</listAttribute>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.poi.dev.OOXMLPrettyPrint"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="C:\temp\imagelink.xlsx C:\temp\imagelink.pretty.xlsx C:\temp\imagelinka.xlsx c:\temp\imagelinka.pretty.xlsx"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ApachePOI"/>
|
|
||||||
</launchConfiguration>
|
|
26
run.sh
26
run.sh
@ -1,26 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# integration-tests fail: https://bitbucket.org/fakraemer/line-break-measurer-test/src/dc8e619063a4?at=master
|
|
||||||
#JAVA_HOME=/devtools/jdk1.6.0_45
|
|
||||||
|
|
||||||
#JAVA_HOME=/devtools/jdk1.7.0_76_x64
|
|
||||||
JAVA_HOME=/devtools/jdk1.8.0_66_x64
|
|
||||||
export JAVA_HOME
|
|
||||||
|
|
||||||
ANT_HOME=/devtools/apache-ant-1.9.4
|
|
||||||
export ANT_HOME
|
|
||||||
|
|
||||||
PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
FORREST_HOME=/devtools/apache-forrest-0.5.1-bin
|
|
||||||
export FORREST_HOME
|
|
||||||
|
|
||||||
ANT_OPTS="-Xmx2048m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:/workspaces"
|
|
||||||
export ANT_OPTS
|
|
||||||
|
|
||||||
rm -f build/*-testokfile.txt
|
|
||||||
|
|
||||||
# -Dadditionaljar=lib/xercesImpl-2.6.1.jar
|
|
||||||
# -Dmain.docs.notRequired=true
|
|
||||||
nice -n 19 /devtools/apache-ant-1.9.6/bin/ant -Dcoverage.enabled=false $*
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# -s /x1/jenkins/jenkins-master/catalina-base/temp/settings7837234259678677409.xml
|
|
||||||
mvn -B -f /workspaces/poi/sonar/pom.xml -Dmaven.repo.local=/workspaces/poi/sonar/repo clean install -U -DskipTests -fae -B && \
|
|
||||||
mvn -f /workspaces/poi/sonar/pom.xml -e -B org.codehaus.mojo:sonar-maven-plugin:2.6:sonar -Dsonar.jdbc.driver=com.mysql.jdbc.Driver \
|
|
||||||
"-Dsonar.jdbc.url=jdbc:mysql://192.168.0.64:3306/sonar?useUnicode=true&characterEncoding=utf8" \
|
|
||||||
-Dsonar.host.url=http://localhost:9090 -Dmaven.repo.local=/workspaces/poi/sonar/repo
|
|
@ -1,86 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/junit-4.12.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/hamcrest-core-1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module" module-name="java" />
|
|
||||||
<orderEntry type="module" module-name="ooxml" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../ooxml-lib/xmlbeans-2.6.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module" module-name="scratchpad" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/ant-1.9.4.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/ant-launcher-1.9.4.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../ooxml-lib/ooxml-encryption-1.2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../ooxml-lib/ooxml-schemas-1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../ooxml-lib/ooxml-security-1.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -39,15 +39,17 @@ public class HPSFFileHandler extends POIFSFileHandler {
|
|||||||
// a test-case to test this locally without executing the full TestAllFiles
|
// a test-case to test this locally without executing the full TestAllFiles
|
||||||
@Test
|
@Test
|
||||||
public void test() throws Exception {
|
public void test() throws Exception {
|
||||||
File file = new File("test-data/document/52372.doc");
|
InputStream stream = new FileInputStream("test-data/hpsf/Test0313rur.adm");
|
||||||
|
|
||||||
InputStream stream = new FileInputStream(file);
|
|
||||||
try {
|
try {
|
||||||
handleFile(stream);
|
handleFile(stream);
|
||||||
} finally {
|
} finally {
|
||||||
stream.close();
|
stream.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleExtracting(file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// a test-case to test this locally without executing the full TestAllFiles
|
||||||
|
@Test
|
||||||
|
public void testExtractor() throws Exception {
|
||||||
|
handleExtracting(new File("test-data/hpsf/TestBug44375.xls"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# integration-tests fail: https://bitbucket.org/fakraemer/line-break-measurer-test/src/dc8e619063a4?at=master
|
|
||||||
#JAVA_HOME=/devtools/jdk1.6.0_45
|
|
||||||
|
|
||||||
#JAVA_HOME=/devtools/jdk1.7.0_76_x64
|
|
||||||
JAVA_HOME=/devtools/jdk1.8.0_66_x64
|
|
||||||
export JAVA_HOME
|
|
||||||
|
|
||||||
ANT_HOME=/devtools/apache-ant-1.9.4
|
|
||||||
export ANT_HOME
|
|
||||||
|
|
||||||
PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
FORREST_HOME=/devtools/apache-forrest-0.5.1-bin
|
|
||||||
export FORREST_HOME
|
|
||||||
|
|
||||||
ANT_OPTS="-Xmx1524m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:/workspaces"
|
|
||||||
export ANT_OPTS
|
|
||||||
|
|
||||||
#rm -f build/*-testokfile.txt
|
|
||||||
|
|
||||||
# -Dadditionaljar=lib/xercesImpl-2.6.1.jar
|
|
||||||
# -Dmain.docs.notRequired=true
|
|
||||||
nice -n 19 /devtools/apache-ant-1.9.6/bin/ant -Dcoverage.enabled=false $*
|
|
@ -1,62 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<content url="file://$MODULE_DIR$/../resources/main">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../resources/main" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<content url="file://$MODULE_DIR$/../testcases">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/../testcases" isTestSource="true" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/commons-logging-1.2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/commons-codec-1.10.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/junit-4.12.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/log4j-1.2.17.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library>
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MODULE_DIR$/../../lib/hamcrest-core-1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -67,7 +67,7 @@ public class POIFSDump {
|
|||||||
is.close();
|
is.close();
|
||||||
|
|
||||||
DirectoryEntry root = fs.getRoot();
|
DirectoryEntry root = fs.getRoot();
|
||||||
File file = new File(new File(args[i]).getName() + "-" + root.getName());
|
File file = new File(root.getName());
|
||||||
file.mkdir();
|
file.mkdir();
|
||||||
|
|
||||||
dump(root, file);
|
dump(root, file);
|
||||||
|
@ -111,17 +111,6 @@ public class XSSFPivotCacheDefinition extends POIXMLDocumentPart{
|
|||||||
//Sets the pivotCacheDefinition tag
|
//Sets the pivotCacheDefinition tag
|
||||||
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTPivotCacheDefinition.type.getName().
|
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTPivotCacheDefinition.type.getName().
|
||||||
getNamespaceURI(), "pivotCacheDefinition"));
|
getNamespaceURI(), "pivotCacheDefinition"));
|
||||||
|
|
||||||
// ensure the fields have names
|
|
||||||
if(ctPivotCacheDefinition.getCacheFields() != null) {
|
|
||||||
CTCacheFields cFields = ctPivotCacheDefinition.getCacheFields();
|
|
||||||
for(CTCacheField cf : cFields.getCacheFieldArray()) {
|
|
||||||
if(cf.getName() == null || cf.getName().isEmpty()) {
|
|
||||||
cf.setName("A");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ctPivotCacheDefinition.save(out, xmlOptions);
|
ctPivotCacheDefinition.save(out, xmlOptions);
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
@ -155,8 +144,7 @@ public class XSSFPivotCacheDefinition extends POIXMLDocumentPart{
|
|||||||
cf.setNumFmtId(0);
|
cf.setNumFmtId(0);
|
||||||
Cell cell = row.getCell(i);
|
Cell cell = row.getCell(i);
|
||||||
cell.setCellType(Cell.CELL_TYPE_STRING);
|
cell.setCellType(Cell.CELL_TYPE_STRING);
|
||||||
String stringCellValue = cell.getStringCellValue();
|
cf.setName(row.getCell(i).getStringCellValue());
|
||||||
cf.setName(stringCellValue);
|
|
||||||
cf.addNewSharedItems();
|
cf.addNewSharedItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2902,16 +2902,15 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
|||||||
// we need to sort it in a way so the shifting does not mess up the structures,
|
// we need to sort it in a way so the shifting does not mess up the structures,
|
||||||
// i.e. when shifting down, start from down and go up, when shifting up, vice-versa
|
// i.e. when shifting down, start from down and go up, when shifting up, vice-versa
|
||||||
SortedMap<XSSFComment, Integer> commentsToShift = new TreeMap<XSSFComment, Integer>(new Comparator<XSSFComment>() {
|
SortedMap<XSSFComment, Integer> commentsToShift = new TreeMap<XSSFComment, Integer>(new Comparator<XSSFComment>() {
|
||||||
@Override
|
public int compare(XSSFComment o1, XSSFComment o2) {
|
||||||
public int compare(XSSFComment o1, XSSFComment o2) {
|
int row1 = o1.getRow();
|
||||||
int row1 = o1.getRow();
|
int row2 = o2.getRow();
|
||||||
int row2 = o2.getRow();
|
|
||||||
|
|
||||||
if(row1 == row2) {
|
if(row1 == row2) {
|
||||||
// ordering is not important when row is equal, but don't return zero to still
|
// ordering is not important when row is equal, but don't return zero to still
|
||||||
// get multiple comments per row into the map
|
// get multiple comments per row into the map
|
||||||
return o1.hashCode() - o2.hashCode();
|
return o1.hashCode() - o2.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// when shifting down, sort higher row-values first
|
// when shifting down, sort higher row-values first
|
||||||
if(n > 0) {
|
if(n > 0) {
|
||||||
@ -2987,78 +2986,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
|||||||
map.put(r.getRowNum(), r);
|
map.put(r.getRowNum(), r);
|
||||||
}
|
}
|
||||||
_rows = map;
|
_rows = map;
|
||||||
|
|
||||||
// bug 57423: also re-order sheetdatamap
|
|
||||||
CTSheetData sheetData = worksheet.getSheetData();
|
|
||||||
SortedMap<Long, CTRow> ctmap = new TreeMap<Long, CTRow>();
|
|
||||||
for(CTRow row : sheetData.getRowArray()) {
|
|
||||||
System.out.println("Having row " + row.getR());
|
|
||||||
ctmap.put(row.getR(), row);
|
|
||||||
}
|
|
||||||
/*Node domNode = sheetData.getDomNode();
|
|
||||||
NodeList childNodes = domNode.getChildNodes();
|
|
||||||
System.out.println("Had: " + childNodes.getLength() + ": " + childNodes);
|
|
||||||
for(int i = 0;i < childNodes.getLength();i++) {
|
|
||||||
Node item = childNodes.item(i);
|
|
||||||
System.out.println("Had: " + i + ": " + item);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//CTRow[] ctArray = new CTRow[ctmap.size()];
|
|
||||||
/*int rowNum = 0;
|
|
||||||
int arrayIdx = 0;
|
|
||||||
for(CTRow row : ctmap.values()) {
|
|
||||||
if(row.getR() != (rowNum+1)) {
|
|
||||||
// XMLBeans releases any previous object in the setters, so we need to
|
|
||||||
// use new objects all the time
|
|
||||||
CTRow newRow = (CTRow) row.copy();
|
|
||||||
|
|
||||||
// we have to copy the Cells as well here as they are not included by
|
|
||||||
// the copy() and would be invalidated otherwise!
|
|
||||||
|
|
||||||
XSSFRow xRow = _rows.get((int)row.getR()-1);
|
|
||||||
int cellCount = 0;
|
|
||||||
for (int cellNum = xRow.getFirstCellNum();cellNum < xRow.getLastCellNum();cellNum++) {
|
|
||||||
XSSFCell xssfCell = xRow.getCell(cellNum);
|
|
||||||
if(xssfCell == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
xssfCell.setCTCell(newRow.getCArray(cellCount));
|
|
||||||
|
|
||||||
cellCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
CTCell[] cArray = new CTCell[cellCount];
|
|
||||||
int i = 0;
|
|
||||||
for (int cellNum = xRow.getFirstCellNum();cellNum < xRow.getLastCellNum();cellNum++) {
|
|
||||||
XSSFCell xssfCell = xRow.getCell(cellNum);
|
|
||||||
if(xssfCell != null) {
|
|
||||||
cArray[i] = (CTCell) xssfCell.getCTCell().copy();
|
|
||||||
i++;
|
|
||||||
|
|
||||||
// we have to copy and re-create the XSSFCell here because the
|
|
||||||
// elements as otherwise setCArray below invalidates all the columns!
|
|
||||||
// see Bug 56170, XMLBeans seems to always release previous objects
|
|
||||||
// in the CArray, so we need to provide completely new ones here!
|
|
||||||
//_cells.put(entry.getKey(), new XSSFCell(this, cArray[i]));
|
|
||||||
xssfCell.setCTCell(cArray[cellNum]);
|
|
||||||
}
|
|
||||||
cellNum++;
|
|
||||||
}
|
|
||||||
|
|
||||||
newRow.setCArray(cArray);
|
|
||||||
|
|
||||||
sheetData.setRowArray(rowNum, row);
|
|
||||||
}
|
|
||||||
rowNum++;
|
|
||||||
}*/
|
|
||||||
//sheetData.setRowArray(ctArray);
|
|
||||||
|
|
||||||
/*CTRow row13 = (CTRow) sheetData.getRowArray(10).copy();
|
|
||||||
CTRow row12 = (CTRow) sheetData.getRowArray(11).copy();
|
|
||||||
sheetData.setRowArray(10, row12);
|
|
||||||
sheetData.setRowArray(11, row13);*/
|
|
||||||
|
|
||||||
//sheetData.getRowList()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int shiftedRowNum(int startRow, int endRow, int n, int rownum) {
|
private int shiftedRowNum(int startRow, int endRow, int n, int rownum) {
|
||||||
@ -3571,7 +3498,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
|||||||
safeGetProtectionField().setSheet(false);
|
safeGetProtectionField().setSheet(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable Autofilters locking.
|
* Enable or disable Autofilters locking.
|
||||||
* This does not modify sheet protection status.
|
* This does not modify sheet protection status.
|
||||||
@ -3799,8 +3725,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
|||||||
return dataValidationHelper;
|
return dataValidationHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
|
|
||||||
public List<XSSFDataValidation> getDataValidations() {
|
public List<XSSFDataValidation> getDataValidations() {
|
||||||
List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>();
|
List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>();
|
||||||
CTDataValidations dataValidations = this.worksheet.getDataValidations();
|
CTDataValidations dataValidations = this.worksheet.getDataValidations();
|
||||||
@ -4176,7 +4100,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
|||||||
return tables;
|
return tables;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getColumnOutlineLevel(int columnIndex) {
|
public int getColumnOutlineLevel(int columnIndex) {
|
||||||
CTCol col = columnHelper.getColumn(columnIndex, false);
|
CTCol col = columnHelper.getColumn(columnIndex, false);
|
||||||
if (col == null) {
|
if (col == null) {
|
||||||
|
@ -24,12 +24,11 @@ import org.apache.poi.ss.usermodel.Row;
|
|||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.ss.util.AreaReference;
|
import org.apache.poi.ss.util.AreaReference;
|
||||||
import org.apache.poi.ss.util.CellReference;
|
import org.apache.poi.ss.util.CellReference;
|
||||||
import org.apache.poi.xssf.XSSFTestDataSamples;
|
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageField;
|
||||||
import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
|
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageFields;
|
||||||
|
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotFields;
|
||||||
import java.io.FileNotFoundException;
|
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition;
|
||||||
import java.io.FileOutputStream;
|
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataConsolidateFunction;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class TestXSSFPivotTable extends TestCase {
|
public class TestXSSFPivotTable extends TestCase {
|
||||||
private XSSFPivotTable pivotTable;
|
private XSSFPivotTable pivotTable;
|
||||||
@ -269,46 +268,4 @@ public class TestXSSFPivotTable extends TestCase {
|
|||||||
}
|
}
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void test58294() throws Exception {
|
|
||||||
XSSFWorkbook wb = new XSSFWorkbook ("C:\\temp\\test1.xlsx");
|
|
||||||
XSSFSheet sheet = wb.getSheetAt(1);
|
|
||||||
XSSFSheet sheet0 = wb.getSheetAt(0);
|
|
||||||
sheet0.setActiveCell("A4");
|
|
||||||
XSSFPivotTable pivotTable = sheet0.createPivotTable(new AreaReference("A3:H6"), new CellReference("A4"), sheet);
|
|
||||||
pivotTable.addRowLabel(1);
|
|
||||||
pivotTable.addRowLabel(3);
|
|
||||||
pivotTable.addRowLabel(5);
|
|
||||||
pivotTable.addColumnLabel(DataConsolidateFunction.SUM, 6, "Sum of days with hauls");
|
|
||||||
pivotTable.addColumnLabel(DataConsolidateFunction.SUM, 7, "Sum of days site cutoff");
|
|
||||||
//checkPivotTables(wb);
|
|
||||||
FileOutputStream fileOut = new FileOutputStream("c:\\temp\\test2new.xlsx");
|
|
||||||
try {
|
|
||||||
wb.write(fileOut);
|
|
||||||
} finally {
|
|
||||||
fileOut.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
XSSFWorkbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
|
||||||
//checkPivotTables(wbBack);
|
|
||||||
|
|
||||||
wb.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkPivotTables(XSSFWorkbook wb) {
|
|
||||||
final List<XSSFPivotTable> pivotTables = wb.getSheetAt(0).getPivotTables();
|
|
||||||
assertNotNull(pivotTables);
|
|
||||||
assertEquals(3, pivotTables.size());
|
|
||||||
final XSSFPivotTable pivotTable = pivotTables.get(2);
|
|
||||||
checkPivotTable(pivotTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkPivotTable(XSSFPivotTable pivotTableBack) {
|
|
||||||
assertNotNull(pivotTableBack.getPivotCacheDefinition());
|
|
||||||
assertNotNull(pivotTableBack.getPivotCacheDefinition().getCTPivotCacheDefinition());
|
|
||||||
final CTCacheFields cacheFields = pivotTableBack.getPivotCacheDefinition().getCTPivotCacheDefinition().getCacheFields();
|
|
||||||
assertNotNull(cacheFields);
|
|
||||||
assertEquals(8, cacheFields.sizeOfCacheFieldArray());
|
|
||||||
assertEquals("A", cacheFields.getCacheFieldList().get(0).getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ import java.io.File;
|
|||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.transform.OutputKeys;
|
import javax.xml.transform.OutputKeys;
|
||||||
@ -42,7 +41,8 @@ public class TestWordToConverterSuite
|
|||||||
/**
|
/**
|
||||||
* YK: a quick hack to exclude failing documents from the suite.
|
* YK: a quick hack to exclude failing documents from the suite.
|
||||||
*/
|
*/
|
||||||
private static List<String> failingFiles = Collections.singletonList("ProblemExtracting.doc");
|
private static List<String> failingFiles = Arrays
|
||||||
|
.asList( "ProblemExtracting.doc" );
|
||||||
|
|
||||||
public static Test suite()
|
public static Test suite()
|
||||||
{
|
{
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
/* ====================================================================
|
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
|
||||||
this work for additional information regarding copyright ownership.
|
|
||||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
||||||
(the "License"); you may not use this file except in compliance with
|
|
||||||
the License. You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
==================================================================== */
|
|
||||||
|
|
||||||
package org.apache.poi.hpsf;
|
|
||||||
|
|
||||||
import org.apache.poi.POIDataSamples;
|
|
||||||
import org.apache.poi.poifs.filesystem.DocumentInputStream;
|
|
||||||
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
public class TestPropertySet {
|
|
||||||
@Test
|
|
||||||
public void test52372() throws IOException, NoPropertySetStreamException, MarkUnsupportedException, UnexpectedPropertySetTypeException {
|
|
||||||
NPOIFSFileSystem poifs = new NPOIFSFileSystem(POIDataSamples.getDocumentInstance().getFile("52372.doc"));
|
|
||||||
|
|
||||||
DocumentInputStream dis = poifs.createDocumentInputStream(SummaryInformation.DEFAULT_STREAM_NAME);
|
|
||||||
PropertySet ps = new PropertySet(dis);
|
|
||||||
SummaryInformation si = new SummaryInformation(ps);
|
|
||||||
dis.close();
|
|
||||||
|
|
||||||
assertNotNull(si);
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,7 +20,6 @@ package org.apache.poi.hssf.usermodel;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -545,25 +544,4 @@ public final class TestCellStyle extends TestCase {
|
|||||||
|
|
||||||
wb.close();
|
wb.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test58607() throws IOException {
|
|
||||||
HSSFWorkbook wb = new HSSFWorkbook();
|
|
||||||
HSSFCellStyle style = wb.createCellStyle();
|
|
||||||
|
|
||||||
style.setDataFormat(wb.createDataFormat().getFormat("dd/MM/yyyy HH:mm:ss"));
|
|
||||||
|
|
||||||
final Cell cell = wb.createSheet("test").createRow(0).createCell(0);
|
|
||||||
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
|
|
||||||
cell.setCellStyle(style);
|
|
||||||
cell.setCellValue(new Date());
|
|
||||||
|
|
||||||
OutputStream out = new FileOutputStream("C:\\temp\\58607.xls");
|
|
||||||
try {
|
|
||||||
wb.write(out);
|
|
||||||
} finally {
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user