import org.apache.poi.hssf.model.RecordStream;
import org.apache.poi.hssf.record.*;
-import org.apache.poi.ss.formula.FormulaShifter;
import org.apache.poi.ss.SpreadsheetVersion;
+import org.apache.poi.ss.formula.FormulaShifter;
/**
*
rowIterator.next();
int result = 0;
while(rowIterator.hasNext() && (i++ < endIndex)) {
- Record rec = (Record)rowIterator.next();
+ Record rec = rowIterator.next();
result += rec.getRecordSize();
rv.visitRecord(rec);
}
return result;
}
- public void visitContainedRecords(RecordVisitor rv) {
+ @Override
+ public void visitContainedRecords(RecordVisitor rv) {
PositionTrackingVisitor stv = new PositionTrackingVisitor(rv, 0);
//DBCells are serialized before row records.
\r
package org.apache.poi.ss.formula.functions;\r
\r
-import org.apache.poi.ss.formula.OperationEvaluationContext;\r
-import org.apache.poi.ss.formula.eval.*;\r
-\r
-import java.math.BigDecimal;\r
+import org.apache.poi.ss.formula.eval.ErrorEval;\r
+import org.apache.poi.ss.formula.eval.EvaluationException;\r
+import org.apache.poi.ss.formula.eval.OperandResolver;\r
+import org.apache.poi.ss.formula.eval.StringEval;\r
+import org.apache.poi.ss.formula.eval.ValueEval;\r
\r
/**\r
* Implementation for Excel REPT () function.<p/>\r
@Override
public void close() {
- // TODO Auto-generated method stub
-
}
@Override
public void flush() {
- // TODO Auto-generated method stub
-
}
@Override
protected InputStream getInputStreamImpl() throws IOException {
- // TODO Auto-generated method stub
return null;
}
@Override
protected OutputStream getOutputStreamImpl() {
- // TODO Auto-generated method stub
return null;
}
@Override
public boolean load(InputStream ios) throws InvalidFormatException {
- // TODO Auto-generated method stub
return false;
}
@Override
public boolean save(OutputStream zos) throws OpenXML4JException {
- // TODO Auto-generated method stub
return false;
}
-
}
@Override
public void close() {
- // TODO Auto-generated method stub
-
}
@Override
public void flush() {
- // TODO Auto-generated method stub
-
}
@Override
protected InputStream getInputStreamImpl() throws IOException {
- // TODO Auto-generated method stub
return null;
}
@Override
protected OutputStream getOutputStreamImpl() {
- // TODO Auto-generated method stub
return null;
}
@Override
public boolean load(InputStream ios) throws InvalidFormatException {
- // TODO Auto-generated method stub
return false;
}
@Override
public boolean save(OutputStream zos) throws OpenXML4JException {
- // TODO Auto-generated method stub
return false;
}
}
==================================================================== */
package org.apache.poi.xslf;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
import org.apache.poi.POIXMLDocument;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFRelation;
import org.apache.xmlbeans.XmlException;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTCommentList;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesSlide;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTPresentation;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdList;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdListEntry;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideMaster;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideMasterIdList;
-import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideMasterIdListEntry;
-import org.openxmlformats.schemas.presentationml.x2006.main.CmLstDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.NotesDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.PresentationDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.SldDocument;
-import org.openxmlformats.schemas.presentationml.x2006.main.SldMasterDocument;
-
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
+import org.openxmlformats.schemas.presentationml.x2006.main.*;
/**
* Experimental class to do low level processing of pptx files.
/**
* Get the document's embedded files.
*/
+ @Override
public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
return embedds;
}
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import junit.framework.TestCase;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
-import org.apache.poi.util.TempFile;
import org.apache.poi.util.PackageHelper;
+import org.apache.poi.util.TempFile;
/**
* Test recursive read and write of OPC packages
super(pkg);
}
+ @Override
public List<PackagePart> getAllEmbedds() {
throw new RuntimeException("not supported");
}
public TestFactory() {
//
}
+ @Override
public POIXMLDocumentPart createDocumentPart(POIXMLDocumentPart parent, PackageRelationship rel, PackagePart part){
return new POIXMLDocumentPart(part, rel);
}
+ @Override
public POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor){
throw new RuntimeException("not supported");
}
private static void traverse(POIXMLDocumentPart part, HashMap<String,POIXMLDocumentPart> context) throws IOException{
context.put(part.getPackageRelationship().getTargetURI().toString(), part);
for(POIXMLDocumentPart p : part.getRelations()){
+ assertNotNull(p.toString());
+
String uri = p.getPackageRelationship().getTargetURI().toString();
if (!context.containsKey(uri)) {
traverse(p, context);
}
}
+
+ public void testCommitNullPart() throws IOException, InvalidFormatException {
+ POIXMLDocumentPart part = new POIXMLDocumentPart();
+ part.prepareForCommit();
+ part.commit();
+ part.onSave(new HashSet<PackagePart>());
+
+ assertNull(part.getRelationById(null));
+ assertNull(part.getRelationId(null));
+ assertFalse(part.removeRelation(null, true));
+ part.removeRelation(null);
+ assertNull(part.toString());
+ part.onDocumentCreate();
+ //part.getTargetPart(null);
+ }
}
*/\r
package org.apache.poi.xslf.usermodel;\r
\r
+import java.io.OutputStream;\r
+import java.util.LinkedHashMap;\r
+import java.util.Map;\r
+\r
import junit.framework.TestCase;\r
+\r
import org.apache.poi.POIXMLDocumentPart;\r
import org.apache.poi.ss.util.CellRangeAddress;\r
import org.apache.poi.ss.util.CellReference;\r
import org.apache.poi.xssf.usermodel.XSSFSheet;\r
import org.apache.poi.xssf.usermodel.XSSFWorkbook;\r
import org.openxmlformats.schemas.drawingml.x2006.chart.*;\r
-import org.openxmlformats.schemas.drawingml.x2006.main.*;\r
-import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector;\r
-\r
-import java.awt.*;\r
-import java.io.*;\r
-import java.util.LinkedHashMap;\r
-import java.util.Map;\r
\r
/**\r
* @author Yegor Kozlov\r
final String name = child.getName();
suite.addTest( new TestCase( name + " [FO]" )
{
+ @Override
public void runTest() throws Exception
{
testFo( child );
} );
suite.addTest( new TestCase( name + " [HTML]" )
{
+ @Override
public void runTest() throws Exception
{
testHtml( child );
==================================================================== */\r
package org.apache.poi.hssf.model;\r
\r
-import junit.framework.TestCase;\r
-import org.apache.poi.ddf.*;\r
-import org.apache.poi.hssf.HSSFTestDataSamples;\r
-import org.apache.poi.hssf.record.ContinueRecord;\r
-import org.apache.poi.hssf.record.DrawingRecord;\r
-import org.apache.poi.hssf.record.EOFRecord;\r
-import org.apache.poi.hssf.record.EscherAggregate;\r
-import org.apache.poi.hssf.record.NoteRecord;\r
-import org.apache.poi.hssf.record.ObjRecord;\r
-import org.apache.poi.hssf.record.Record;\r
-import org.apache.poi.hssf.record.RecordBase;\r
-import org.apache.poi.hssf.record.RecordFactory;\r
-import org.apache.poi.hssf.record.TextObjectRecord;\r
-import org.apache.poi.hssf.record.WindowTwoRecord;\r
-import org.apache.poi.hssf.record.aggregates.RowRecordsAggregate;\r
-import org.apache.poi.hssf.usermodel.HSSFPatriarch;\r
-import org.apache.poi.hssf.usermodel.HSSFSheet;\r
-import org.apache.poi.hssf.usermodel.HSSFTestHelper;\r
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;\r
-import org.apache.poi.util.HexDump;\r
-import org.apache.poi.util.HexRead;\r
-\r
import java.io.ByteArrayInputStream;\r
import java.io.ByteArrayOutputStream;\r
import java.io.File;\r
import java.util.List;\r
import java.util.Map;\r
\r
+import junit.framework.TestCase;\r
+\r
+import org.apache.poi.ddf.DefaultEscherRecordFactory;\r
+import org.apache.poi.ddf.EscherContainerRecord;\r
+import org.apache.poi.ddf.EscherDggRecord;\r
+import org.apache.poi.ddf.EscherRecord;\r
+import org.apache.poi.ddf.EscherRecordFactory;\r
+import org.apache.poi.hssf.HSSFTestDataSamples;\r
+import org.apache.poi.hssf.record.*;\r
+import org.apache.poi.hssf.record.aggregates.RowRecordsAggregate;\r
+import org.apache.poi.hssf.usermodel.HSSFPatriarch;\r
+import org.apache.poi.hssf.usermodel.HSSFSheet;\r
+import org.apache.poi.hssf.usermodel.HSSFTestHelper;\r
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;\r
+import org.apache.poi.util.HexDump;\r
+import org.apache.poi.util.HexRead;\r
+\r
/**\r
* @author Yegor Kozlov\r
* @author Evgeniy Berlog\r
}\r
}\r
);\r
+ assertNotNull(\r
+ "Need to find files in test-data path, had path: " + new File(System.getProperty("POI.testdata.path"), "spreadsheet"), \r
+ xls);\r
for(File file : xls) {\r
HSSFWorkbook wb;\r
try {\r