git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1872610 13f79535-47bb-0310-9956-ffa450edef68tags/REL_4_1_2
@@ -132,7 +132,7 @@ public class XLS2CSVmra implements HSSFListener { | |||
* CSV as the file is processed. | |||
*/ | |||
@Override | |||
public void processRecord(Record record) { | |||
public void processRecord(org.apache.poi.hssf.record.Record record) { | |||
int thisRow = -1; | |||
int thisColumn = -1; | |||
String thisStr = null; |
@@ -39,7 +39,7 @@ public class EventExample implements HSSFListener { | |||
* @param record The record that was found while reading. | |||
*/ | |||
@Override | |||
public void processRecord(Record record) | |||
public void processRecord(org.apache.poi.hssf.record.Record record) | |||
{ | |||
switch (record.getSid()) | |||
{ |
@@ -33,8 +33,8 @@ import org.junit.Test; | |||
*/ | |||
public class RecordsStresser { | |||
public static void handleWorkbook(HSSFWorkbook wb) { | |||
List<Record> records = wb.getWorkbook().getRecords(); | |||
for(Record record : records) { | |||
List<org.apache.poi.hssf.record.Record> records = wb.getWorkbook().getRecords(); | |||
for(org.apache.poi.hssf.record.Record record : records) { | |||
// some Records do not implement clone ?! | |||
// equals instead of instanceof is on purpose here to only skip exactly this class and not any derived ones | |||
// if(record.getClass().equals(InterfaceHdrRecord.class) || |
@@ -36,9 +36,9 @@ public class HSLFFileHandler extends SlideShowHandler { | |||
assertNotNull(slide.getEmbeddedObjects()); | |||
assertNotNull(slide.getUnderlyingBytes()); | |||
assertNotNull(slide.getPictureData()); | |||
Record[] records = slide.getRecords(); | |||
org.apache.poi.hssf.record.Record[] records = slide.getRecords(); | |||
assertNotNull(records); | |||
for(Record record : records) { | |||
for(org.apache.poi.hssf.record.Record record : records) { | |||
assertNotNull("Found a record which was null", record); | |||
assertTrue(record.getRecordType() >= 0); | |||
} |
@@ -91,7 +91,7 @@ public final class BiffViewer { | |||
if (recStream.getSid() == 0) { | |||
continue; | |||
} | |||
Record record; | |||
org.apache.poi.hssf.record.Record record; | |||
if (dumpInterpretedRecords) { | |||
record = createRecord (recStream); | |||
if (record.getSid() == ContinueRecord.sid) { | |||
@@ -115,7 +115,7 @@ public final class BiffViewer { | |||
* up non-debug operations. | |||
* | |||
*/ | |||
private static Record createRecord(RecordInputStream in) { | |||
private static org.apache.poi.hssf.record.Record createRecord(RecordInputStream in) { | |||
switch (in.getSid()) { | |||
case AreaFormatRecord.sid: return new AreaFormatRecord(in); | |||
case AreaRecord.sid: return new AreaRecord(in); |
@@ -57,9 +57,9 @@ public class FormulaViewer | |||
public void run() throws IOException { | |||
try (POIFSFileSystem fs = new POIFSFileSystem(new File(file), true)) { | |||
try (InputStream is = BiffViewer.getPOIFSInputStream(fs)) { | |||
List<Record> records = RecordFactory.createRecords(is); | |||
List<org.apache.poi.hssf.record.Record> records = RecordFactory.createRecords(is); | |||
for (Record record : records) { | |||
for (org.apache.poi.hssf.record.Record record : records) { | |||
if (record.getSid() == FormulaRecord.sid) { | |||
if (list) { | |||
listFormula((FormulaRecord) record); |
@@ -36,5 +36,5 @@ public interface ERFListener | |||
* | |||
* @return boolean specifying whether the effort was a success. | |||
*/ | |||
public boolean processRecord(Record rec); | |||
public boolean processRecord(org.apache.poi.hssf.record.Record rec); | |||
} |
@@ -28,7 +28,7 @@ import org.apache.poi.util.RecordFormatException; | |||
/** | |||
* Event-based record factory. As opposed to RecordFactory | |||
* this version sends {@link ERFListener#processRecord(Record) } messages to | |||
* this version sends {@link ERFListener#processRecord(org.apache.poi.hssf.record.Record) } messages to | |||
* the supplied listener. Record notifications are sent one record behind | |||
* to ensure that {@link ContinueRecord}s are processed first. | |||
*/ | |||
@@ -68,7 +68,7 @@ public final class EventRecordFactory { | |||
* @return <code>false</code> to abort. This aborts | |||
* out of the event loop should the listener return false | |||
*/ | |||
private boolean processRecord(Record record) { | |||
private boolean processRecord(org.apache.poi.hssf.record.Record record) { | |||
if (!isSidIncluded(record.getSid())) { | |||
return true; | |||
} | |||
@@ -93,7 +93,7 @@ public final class EventRecordFactory { | |||
recStream.nextRecord(); | |||
Record[] recs = RecordFactory.createRecord(recStream); // handle MulRK records | |||
if (recs.length > 1) { | |||
for (Record rec : recs) { | |||
for (org.apache.poi.hssf.record.Record rec : recs) { | |||
if ( last_record != null ) { | |||
if (!processRecord(last_record)) { | |||
return; |
@@ -24,7 +24,7 @@ import org.apache.poi.hssf.record.Record; | |||
* Abstract class for use with the HSSFRequest and HSSFEventFactory, which | |||
* allows for the halting of processing. | |||
* Users should create subclass of this (which implements the usual | |||
* HSSFListener), and then override the #abortableProcessRecord(Record) | |||
* HSSFListener), and then override the #abortableProcessRecord(org.apache.poi.hssf.record.Record) | |||
* method to do their processing. | |||
* This should then be registered with the HSSFRequest (associating | |||
* it with Record SID's) as usual. | |||
@@ -42,7 +42,7 @@ public abstract class AbortableHSSFListener implements HSSFListener | |||
* You should implement #abortableProcessRecord instead | |||
*/ | |||
@Override | |||
public void processRecord(Record record) | |||
public void processRecord(org.apache.poi.hssf.record.Record record) | |||
{ | |||
} | |||
@@ -67,5 +67,5 @@ public abstract class AbortableHSSFListener implements HSSFListener | |||
* @throws HSSFUserException User code can throw this to abort | |||
* file processing by HSSFEventFactory and return diagnostic information. | |||
*/ | |||
public abstract short abortableProcessRecord(Record record) throws HSSFUserException; | |||
public abstract short abortableProcessRecord(org.apache.poi.hssf.record.Record record) throws HSSFUserException; | |||
} |
@@ -66,7 +66,7 @@ public class EventWorkbookBuilder { | |||
*/ | |||
public static InternalWorkbook createStubWorkbook(ExternSheetRecord[] externs, | |||
BoundSheetRecord[] bounds, SSTRecord sst) { | |||
List<Record> wbRecords = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> wbRecords = new ArrayList<>(); | |||
// Core Workbook records go first | |||
if(bounds != null) { | |||
@@ -157,7 +157,7 @@ public class EventWorkbookBuilder { | |||
* pass it on to our child listener | |||
*/ | |||
@Override | |||
public void processRecord(Record record) { | |||
public void processRecord(org.apache.poi.hssf.record.Record record) { | |||
// Handle it ourselves | |||
processRecordInternally(record); | |||
@@ -171,7 +171,7 @@ public class EventWorkbookBuilder { | |||
* | |||
* @param record the record to be processed | |||
*/ | |||
public void processRecordInternally(Record record) { | |||
public void processRecordInternally(org.apache.poi.hssf.record.Record record) { | |||
if(record instanceof BoundSheetRecord) { | |||
boundSheetRecords.add((BoundSheetRecord)record); | |||
} |
@@ -84,7 +84,7 @@ public class FormatTrackingHSSFListener implements HSSFListener { | |||
* Process this record ourselves, and then pass it on to our child listener | |||
*/ | |||
@Override | |||
public void processRecord(Record record) { | |||
public void processRecord(org.apache.poi.hssf.record.Record record) { | |||
// Handle it ourselves | |||
processRecordInternally(record); | |||
@@ -98,7 +98,7 @@ public class FormatTrackingHSSFListener implements HSSFListener { | |||
* | |||
* @param record the record to be processed | |||
*/ | |||
public void processRecordInternally(Record record) { | |||
public void processRecordInternally(org.apache.poi.hssf.record.Record record) { | |||
if (record instanceof FormatRecord) { | |||
FormatRecord fr = (FormatRecord) record; | |||
_customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr); |
@@ -165,7 +165,7 @@ public class HSSFEventFactory { | |||
// Process each record as they come in | |||
while(true) { | |||
Record r = recordStream.nextRecord(); | |||
org.apache.poi.hssf.record.Record r = recordStream.nextRecord(); | |||
if(r == null) { | |||
break; | |||
} |
@@ -37,5 +37,5 @@ public interface HSSFListener | |||
* | |||
* @param record the record to be processed | |||
*/ | |||
public void processRecord(Record record); | |||
public void processRecord(org.apache.poi.hssf.record.Record record); | |||
} |
@@ -88,7 +88,7 @@ public class HSSFRequest { | |||
* @return numeric user-specified result code. If zero continue processing. | |||
* @throws HSSFUserException User exception condition | |||
*/ | |||
protected short processRecord(Record rec) throws HSSFUserException { | |||
protected short processRecord(org.apache.poi.hssf.record.Record rec) throws HSSFUserException { | |||
List<HSSFListener> listeners = _records.get(Short.valueOf(rec.getSid())); | |||
short userCode = 0; | |||
@@ -63,7 +63,7 @@ public final class MissingRecordAwareHSSFListener implements HSSFListener { | |||
childListener = listener; | |||
} | |||
public void processRecord(Record record) { | |||
public void processRecord(org.apache.poi.hssf.record.Record record) { | |||
int thisRow; | |||
int thisColumn; | |||
CellValueRecordInterface[] expandedRecords = null; | |||
@@ -195,7 +195,7 @@ public final class MissingRecordAwareHSSFListener implements HSSFListener { | |||
// Pass along the record(s) | |||
if(expandedRecords != null && expandedRecords.length > 0) { | |||
for(CellValueRecordInterface r : expandedRecords) { | |||
childListener.processRecord((Record)r); | |||
childListener.processRecord((org.apache.poi.hssf.record.Record)r); | |||
} | |||
} else { | |||
childListener.processRecord(record); |
@@ -172,7 +172,7 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or | |||
public TextListener() { | |||
sheetNames = new ArrayList<>(); | |||
} | |||
public void processRecord(Record record) { | |||
public void processRecord(org.apache.poi.hssf.record.Record record) { | |||
String thisText = null; | |||
int thisRow = -1; | |||
@@ -144,7 +144,7 @@ public final class InternalSheet { | |||
// Not a supported type | |||
// Skip onto the EOF, then complain | |||
while (rs.hasNext()) { | |||
Record rec = rs.getNext(); | |||
org.apache.poi.hssf.record.Record rec = rs.getNext(); | |||
if (rec instanceof EOFRecord) { | |||
break; | |||
} | |||
@@ -229,7 +229,7 @@ public final class InternalSheet { | |||
continue; | |||
} | |||
Record rec = rs.getNext(); | |||
org.apache.poi.hssf.record.Record rec = rs.getNext(); | |||
if ( recSid == IndexRecord.sid ) { | |||
// ignore INDEX record because it is only needed by Excel, | |||
// and POI always re-calculates its contents | |||
@@ -334,10 +334,7 @@ public final class InternalSheet { | |||
log.log(POILogger.DEBUG, "sheet createSheet (existing file) exited"); | |||
} | |||
private static void spillAggregate(RecordAggregate ra, final List<RecordBase> recs) { | |||
ra.visitContainedRecords(new RecordVisitor() { | |||
public void visitRecord(Record r) { | |||
recs.add(r); | |||
}}); | |||
ra.visitContainedRecords(r -> recs.add(r)); | |||
} | |||
public static class UnsupportedBOFType extends RecordFormatException { | |||
@@ -354,12 +351,12 @@ public final class InternalSheet { | |||
private static final class RecordCloner implements RecordVisitor { | |||
private final List<Record> _destList; | |||
private final List<org.apache.poi.hssf.record.Record> _destList; | |||
public RecordCloner(List<Record> destList) { | |||
public RecordCloner(List<org.apache.poi.hssf.record.Record> destList) { | |||
_destList = destList; | |||
} | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
_destList.add(r.copy()); | |||
} | |||
} | |||
@@ -374,7 +371,7 @@ public final class InternalSheet { | |||
* @return the cloned sheet | |||
*/ | |||
public InternalSheet cloneSheet() { | |||
List<Record> clonedRecords = new ArrayList<>(_records.size()); | |||
List<org.apache.poi.hssf.record.Record> clonedRecords = new ArrayList<>(_records.size()); | |||
for (int i = 0; i < _records.size(); i++) { | |||
RecordBase rb = _records.get(i); | |||
if (rb instanceof RecordAggregate) { | |||
@@ -387,7 +384,7 @@ public final class InternalSheet { | |||
*/ | |||
rb = new DrawingRecord(); | |||
} | |||
Record rec = ((Record) rb).copy(); | |||
org.apache.poi.hssf.record.Record rec = ((org.apache.poi.hssf.record.Record) rb).copy(); | |||
clonedRecords.add(rec); | |||
} | |||
return createSheet(new RecordStream(clonedRecords, 0)); | |||
@@ -571,7 +568,7 @@ public final class InternalSheet { | |||
RecordAggregate agg = (RecordAggregate) record; | |||
agg.visitContainedRecords(ptv); | |||
} else { | |||
ptv.visitRecord((Record) record); | |||
ptv.visitRecord((org.apache.poi.hssf.record.Record) record); | |||
} | |||
// If the BOF record was just serialized then add the IndexRecord | |||
@@ -1254,12 +1251,12 @@ public final class InternalSheet { | |||
* | |||
* @return the matching record or {@code null} if it wasn't found | |||
*/ | |||
public Record findFirstRecordBySid(short sid) { | |||
public org.apache.poi.hssf.record.Record findFirstRecordBySid(short sid) { | |||
int ix = findFirstRecordLocBySid(sid); | |||
if (ix < 0) { | |||
return null; | |||
} | |||
return (Record) _records.get(ix); | |||
return (org.apache.poi.hssf.record.Record) _records.get(ix); | |||
} | |||
/** | |||
@@ -1290,10 +1287,10 @@ public final class InternalSheet { | |||
int max = _records.size(); | |||
for (int i=0; i< max; i++) { | |||
Object rb = _records.get(i); | |||
if (!(rb instanceof Record)) { | |||
if (!(rb instanceof org.apache.poi.hssf.record.Record)) { | |||
continue; | |||
} | |||
Record record = (Record) rb; | |||
org.apache.poi.hssf.record.Record record = (org.apache.poi.hssf.record.Record) rb; | |||
if (record.getSid() == sid) { | |||
return i; | |||
} |
@@ -179,15 +179,15 @@ public final class InternalWorkbook { | |||
* @param recs an array of Record objects | |||
* @return Workbook object | |||
*/ | |||
public static InternalWorkbook createWorkbook(List<Record> recs) { | |||
public static InternalWorkbook createWorkbook(List<org.apache.poi.hssf.record.Record> recs) { | |||
LOG.log(DEBUG, "Workbook (readfile) created with reclen=", recs.size()); | |||
InternalWorkbook retval = new InternalWorkbook(); | |||
List<Record> records = new ArrayList<>(recs.size() / 3); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(recs.size() / 3); | |||
retval.records.setRecords(records); | |||
boolean eofPassed = false; | |||
for (int k = 0; k < recs.size(); k++) { | |||
Record rec = recs.get(k); | |||
org.apache.poi.hssf.record.Record rec = recs.get(k); | |||
String logObj; | |||
switch (rec.getSid()) { | |||
@@ -328,7 +328,7 @@ public final class InternalWorkbook { | |||
LOG.log( DEBUG, "creating new workbook from scratch" ); | |||
InternalWorkbook retval = new InternalWorkbook(); | |||
List<Record> records = new ArrayList<>(30); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(30); | |||
retval.records.setRecords(records); | |||
List<FormatRecord> formats = retval.formats; | |||
@@ -604,7 +604,7 @@ public final class InternalWorkbook { | |||
// also adjust order of Records, calculate the position of the Boundsheets via getBspos()... | |||
int initialBspos = records.getBspos(); | |||
int pos0 = initialBspos - (boundsheets.size() - 1); | |||
Record removed = records.get(pos0 + sheetNumber); | |||
org.apache.poi.hssf.record.Record removed = records.get(pos0 + sheetNumber); | |||
records.remove(pos0 + sheetNumber); | |||
records.add(pos0 + pos, removed); | |||
records.setBspos(initialBspos); | |||
@@ -774,7 +774,7 @@ public final class InternalWorkbook { | |||
* make the tabid record look like the current situation. | |||
*/ | |||
private void fixTabIdRecord() { | |||
Record rec = records.get(records.getTabpos()); | |||
org.apache.poi.hssf.record.Record rec = records.get(records.getTabpos()); | |||
// see bug 55982, quite a number of documents do not have a TabIdRecord and | |||
// thus there is no way to do the fixup here, | |||
@@ -885,7 +885,7 @@ public final class InternalWorkbook { | |||
// Style records always follow after | |||
// the ExtendedFormat records | |||
for(int i=records.getXfpos(); i<records.size(); i++) { | |||
Record r = records.get(i); | |||
org.apache.poi.hssf.record.Record r = records.get(i); | |||
if (r instanceof StyleRecord) { | |||
StyleRecord sr = (StyleRecord)r; | |||
if (sr.getXFIndex() == xfIndex) { | |||
@@ -907,7 +907,7 @@ public final class InternalWorkbook { | |||
// Style records always follow after | |||
// the ExtendedFormat records | |||
for(int i=records.getXfpos(); i<records.size(); i++) { | |||
Record r = records.get(i); | |||
org.apache.poi.hssf.record.Record r = records.get(i); | |||
if (r instanceof StyleRecord) { | |||
StyleRecord sr = (StyleRecord)r; | |||
if (sr.getXFIndex() == oldXf) { | |||
@@ -936,7 +936,7 @@ public final class InternalWorkbook { | |||
int addAt = -1; | |||
for(int i=records.getXfpos(); i<records.size() && | |||
addAt == -1; i++) { | |||
Record r = records.get(i); | |||
org.apache.poi.hssf.record.Record r = records.get(i); | |||
if(r instanceof ExtendedFormatRecord || | |||
r instanceof StyleRecord) { | |||
// Keep going | |||
@@ -1015,7 +1015,7 @@ public final class InternalWorkbook { | |||
SSTRecord lSST = null; | |||
int sstPos = 0; | |||
boolean wroteBoundSheets = false; | |||
for ( Record record : records.getRecords() ) { | |||
for ( org.apache.poi.hssf.record.Record record : records.getRecords() ) { | |||
int len = 0; | |||
if (record instanceof SSTRecord) { | |||
lSST = (SSTRecord)record; | |||
@@ -1061,7 +1061,7 @@ public final class InternalWorkbook { | |||
int retval = 0; | |||
SSTRecord lSST = null; | |||
for ( Record record : records.getRecords() ) { | |||
for ( org.apache.poi.hssf.record.Record record : records.getRecords() ) { | |||
if (record instanceof SSTRecord) { | |||
lSST = (SSTRecord)record; | |||
} | |||
@@ -1733,8 +1733,8 @@ public final class InternalWorkbook { | |||
* | |||
* @return the matching record or {@code null} if it wasn't found | |||
*/ | |||
public Record findFirstRecordBySid(short sid) { | |||
for (Record record : records.getRecords() ) { | |||
public org.apache.poi.hssf.record.Record findFirstRecordBySid(short sid) { | |||
for (org.apache.poi.hssf.record.Record record : records.getRecords() ) { | |||
if (record.getSid() == sid) { | |||
return record; | |||
} | |||
@@ -1749,7 +1749,7 @@ public final class InternalWorkbook { | |||
*/ | |||
public int findFirstRecordLocBySid(short sid) { | |||
int index = 0; | |||
for (Record record : records.getRecords() ) { | |||
for (org.apache.poi.hssf.record.Record record : records.getRecords() ) { | |||
if (record.getSid() == sid) { | |||
return index; | |||
} | |||
@@ -1766,9 +1766,9 @@ public final class InternalWorkbook { | |||
* | |||
* @return the matching record or {@code null} if it wasn't found | |||
*/ | |||
public Record findNextRecordBySid(short sid, int pos) { | |||
public org.apache.poi.hssf.record.Record findNextRecordBySid(short sid, int pos) { | |||
int matches = 0; | |||
for (Record record : records.getRecords() ) { | |||
for (org.apache.poi.hssf.record.Record record : records.getRecords() ) { | |||
if (record.getSid() == sid && matches++ == pos) { | |||
return record; | |||
} | |||
@@ -1781,7 +1781,7 @@ public final class InternalWorkbook { | |||
return hyperlinks; | |||
} | |||
public List<Record> getRecords() { | |||
public List<org.apache.poi.hssf.record.Record> getRecords() { | |||
return records.getRecords(); | |||
} | |||
@@ -1805,7 +1805,7 @@ public final class InternalWorkbook { | |||
PaletteRecord palette; | |||
int palettePos = records.getPalettepos(); | |||
if (palettePos != -1) { | |||
Record rec = records.get(palettePos); | |||
org.apache.poi.hssf.record.Record rec = records.get(palettePos); | |||
if (rec instanceof PaletteRecord) { | |||
palette = (PaletteRecord) rec; | |||
} else { | |||
@@ -1832,7 +1832,7 @@ public final class InternalWorkbook { | |||
} | |||
// Need to find a DrawingGroupRecord that contains a EscherDggRecord | |||
for(Record r : records.getRecords() ) { | |||
for(org.apache.poi.hssf.record.Record r : records.getRecords() ) { | |||
if (!(r instanceof DrawingGroupRecord)) { | |||
continue; | |||
} |
@@ -188,7 +188,7 @@ final class LinkTable { | |||
private final int _recordCount; | |||
private final WorkbookRecordList _workbookRecordList; // TODO - would be nice to remove this | |||
public LinkTable(List<Record> inputList, int startIndex, WorkbookRecordList workbookRecordList, Map<String, NameCommentRecord> commentRecords) { | |||
public LinkTable(List<org.apache.poi.hssf.record.Record> inputList, int startIndex, WorkbookRecordList workbookRecordList, Map<String, NameCommentRecord> commentRecords) { | |||
_workbookRecordList = workbookRecordList; | |||
RecordStream rs = new RecordStream(inputList, startIndex); | |||
@@ -524,7 +524,7 @@ final class LinkTable { | |||
*/ | |||
private int findFirstRecordLocBySid(short sid) { | |||
int index = 0; | |||
for (Record record : _workbookRecordList.getRecords()) { | |||
for (org.apache.poi.hssf.record.Record record : _workbookRecordList.getRecords()) { | |||
if (record.getSid() == sid) { | |||
return index; | |||
} | |||
@@ -641,7 +641,7 @@ final class LinkTable { | |||
int supLinkIndex = 0; | |||
// find the posistion of the Add-In SupBookRecord in the workbook stream, | |||
// the created ExternalNameRecord will be appended to it | |||
for (Record record : _workbookRecordList.getRecords()) { | |||
for (org.apache.poi.hssf.record.Record record : _workbookRecordList.getRecords()) { | |||
if (record instanceof SupBookRecord && ((SupBookRecord) record).isAddInFunctions()) { | |||
break; | |||
} |
@@ -162,7 +162,7 @@ final class RecordOrderer { | |||
return true; // oo COLINFO | |||
} | |||
if (rb instanceof Record) { | |||
Record record = (Record) rb; | |||
Record record = (org.apache.poi.hssf.record.Record) rb; | |||
switch (record.getSid()) { | |||
case DefaultColWidthRecord.sid: | |||
case UnknownRecord.SORT_0090: | |||
@@ -186,7 +186,7 @@ final class RecordOrderer { | |||
} | |||
private static boolean isPageBreakPriorRecord(Object rb) { | |||
if (rb instanceof Record) { | |||
Record record = (Record) rb; | |||
Record record = (org.apache.poi.hssf.record.Record) rb; | |||
switch (record.getSid()) { | |||
case BOFRecord.sid: | |||
case IndexRecord.sid: | |||
@@ -226,7 +226,7 @@ final class RecordOrderer { | |||
continue; | |||
} | |||
Record rec = (Record) rb; | |||
Record rec = (org.apache.poi.hssf.record.Record) rb; | |||
switch (rec.getSid()) { | |||
case WindowTwoRecord.sid: | |||
case SCLRecord.sid: | |||
@@ -253,7 +253,7 @@ final class RecordOrderer { | |||
// even PageSettingsBlock (which doesn't normally appear after 'View Settings') | |||
continue; | |||
} | |||
Record rec = (Record) rb; | |||
Record rec = (org.apache.poi.hssf.record.Record) rb; | |||
switch (rec.getSid()) { | |||
// 'View Settings' (4 records) | |||
case WindowTwoRecord.sid: | |||
@@ -298,14 +298,14 @@ final class RecordOrderer { | |||
i--; | |||
RecordBase rb = records.get(i); | |||
if (isDVTPriorRecord(rb)) { | |||
Record nextRec = (Record) records.get(i + 1); | |||
Record nextRec = (org.apache.poi.hssf.record.Record) records.get(i + 1); | |||
if (!isDVTSubsequentRecord(nextRec.getSid())) { | |||
throw new IllegalStateException("Unexpected (" + nextRec.getClass().getName() | |||
+ ") found after (" + rb.getClass().getName() + ")"); | |||
} | |||
return i+1; | |||
} | |||
Record rec = (Record) rb; | |||
Record rec = (org.apache.poi.hssf.record.Record) rb; | |||
if (!isDVTSubsequentRecord(rec.getSid())) { | |||
throw new IllegalStateException("Unexpected (" + rec.getClass().getName() | |||
+ ") while looking for DV Table insert pos"); | |||
@@ -319,7 +319,7 @@ final class RecordOrderer { | |||
if (rb instanceof MergedCellsTable || rb instanceof ConditionalFormattingTable) { | |||
return true; | |||
} | |||
short sid = ((Record)rb).getSid(); | |||
short sid = ((org.apache.poi.hssf.record.Record)rb).getSid(); | |||
switch(sid) { | |||
case WindowTwoRecord.sid: | |||
case UnknownRecord.SCL_00A0: | |||
@@ -379,7 +379,7 @@ final class RecordOrderer { | |||
private static boolean isGutsPriorRecord(RecordBase rb) { | |||
if (rb instanceof Record) { | |||
Record record = (Record) rb; | |||
Record record = (org.apache.poi.hssf.record.Record) rb; | |||
switch (record.getSid()) { | |||
case BOFRecord.sid: | |||
case IndexRecord.sid: |
@@ -25,7 +25,7 @@ import org.apache.poi.hssf.record.Record; | |||
*/ | |||
public final class RecordStream { | |||
private final List<Record> _list; | |||
private final List<org.apache.poi.hssf.record.Record> _list; | |||
private int _nextIndex; | |||
private int _countRead; | |||
private final int _endIx; | |||
@@ -37,14 +37,14 @@ public final class RecordStream { | |||
* @param startIndex the start index within the list | |||
* @param endIx the end index within the list, which is the index of the end element + 1 | |||
*/ | |||
public RecordStream(List<Record> inputList, int startIndex, int endIx) { | |||
public RecordStream(List<org.apache.poi.hssf.record.Record> inputList, int startIndex, int endIx) { | |||
_list = inputList; | |||
_nextIndex = startIndex; | |||
_endIx = endIx; | |||
_countRead = 0; | |||
} | |||
public RecordStream(List<Record> records, int startIx) { | |||
public RecordStream(List<org.apache.poi.hssf.record.Record> records, int startIx) { | |||
this(records, startIx, records.size()); | |||
} | |||
@@ -36,7 +36,7 @@ import org.apache.poi.ss.util.CellReference; | |||
*/ | |||
public final class RowBlocksReader { | |||
private final List<Record> _plainRecords; | |||
private final List<org.apache.poi.hssf.record.Record> _plainRecords; | |||
private final SharedValueManager _sfm; | |||
private final MergeCellsRecord[] _mergedCellsRecords; | |||
@@ -47,12 +47,12 @@ public final class RowBlocksReader { | |||
* @param rs the record stream | |||
*/ | |||
public RowBlocksReader(RecordStream rs) { | |||
List<Record> plainRecords = new ArrayList<>(); | |||
List<Record> shFrmRecords = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> plainRecords = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> shFrmRecords = new ArrayList<>(); | |||
List<CellReference> firstCellRefs = new ArrayList<>(); | |||
List<Record> arrayRecords = new ArrayList<>(); | |||
List<Record> tableRecords = new ArrayList<>(); | |||
List<Record> mergeCellRecords = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> arrayRecords = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> tableRecords = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> mergeCellRecords = new ArrayList<>(); | |||
Record prevRec = null; | |||
while(!RecordOrderer.isEndOfRowBlock(rs.peekNextSid())) { | |||
@@ -65,7 +65,7 @@ public final class RowBlocksReader { | |||
} | |||
Record rec = rs.getNext(); | |||
List<Record> dest; | |||
List<org.apache.poi.hssf.record.Record> dest; | |||
switch (rec.getSid()) { | |||
case MergeCellsRecord.sid: dest = mergeCellRecords; break; | |||
case SharedFormulaRecord.sid: dest = shFrmRecords; |
@@ -23,7 +23,7 @@ import java.util.List; | |||
import org.apache.poi.hssf.record.Record; | |||
public final class WorkbookRecordList { | |||
private List<Record> records = new ArrayList<>(); | |||
private List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
/** holds the position of the protect record */ | |||
private int protpos; | |||
@@ -47,7 +47,7 @@ public final class WorkbookRecordList { | |||
private int palettepos = -1; | |||
public void setRecords(List<Record> records) { | |||
public void setRecords(List<org.apache.poi.hssf.record.Record> records) { | |||
this.records = records; | |||
} | |||
@@ -64,7 +64,7 @@ public final class WorkbookRecordList { | |||
updateRecordPos(pos, true); | |||
} | |||
public List<Record> getRecords() { | |||
public List<org.apache.poi.hssf.record.Record> getRecords() { | |||
return records; | |||
} | |||
@@ -76,7 +76,7 @@ public final class WorkbookRecordList { | |||
public void remove( Object record ) { | |||
// can't use List.indexOf here because it checks the records for equality and not identity | |||
int i = 0; | |||
for (Record r : records) { | |||
for (org.apache.poi.hssf.record.Record r : records) { | |||
if (r == record) { | |||
remove(i); | |||
break; |
@@ -439,7 +439,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { | |||
loc++; | |||
continue; | |||
} | |||
Record objRecord = (Record) records.get(loc); | |||
Record objRecord = (org.apache.poi.hssf.record.Record) records.get(loc); | |||
agg.shapeToObj.put(shapeRecords.get(shapeIndex++), objRecord); | |||
loc++; | |||
} | |||
@@ -635,7 +635,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { | |||
continueRecordsHeadersSize += 4; | |||
} | |||
int objRecordSize = 0; | |||
for (Record r : shapeToObj.values()) { | |||
for (org.apache.poi.hssf.record.Record r : shapeToObj.values()) { | |||
objRecordSize += r.getRecordSize(); | |||
} | |||
int tailRecordSize = 0; | |||
@@ -771,7 +771,7 @@ public final class EscherAggregate extends AbstractEscherHolderRecord { | |||
private static short sid(List<RecordBase> records, int loc) { | |||
RecordBase record = records.get(loc); | |||
if (record instanceof Record) { | |||
return ((Record)record).getSid(); | |||
return ((org.apache.poi.hssf.record.Record)record).getSid(); | |||
} else { | |||
// Aggregates don't have a sid | |||
// We could step into them, but for these needs we don't care |
@@ -32,7 +32,7 @@ public final class InterfaceEndRecord extends StandardRecord { | |||
// enforce singleton | |||
} | |||
public static Record create(RecordInputStream in) { | |||
public static org.apache.poi.hssf.record.Record create(RecordInputStream in) { | |||
switch (in.remaining()) { | |||
case 0: | |||
return instance; |
@@ -113,7 +113,7 @@ public final class RecordFactory { | |||
public Record create(RecordInputStream in) { | |||
Object[] args = { in, }; | |||
try { | |||
return (Record) _m.invoke(null, args); | |||
return (org.apache.poi.hssf.record.Record) _m.invoke(null, args); | |||
} catch (IllegalArgumentException | IllegalAccessException e) { | |||
throw new RuntimeException(e); | |||
} catch (InvocationTargetException e) { | |||
@@ -314,7 +314,7 @@ public final class RecordFactory { | |||
* @param in the RecordInputStream to read from | |||
* @return the extracted records | |||
*/ | |||
public static Record [] createRecord(RecordInputStream in) { | |||
public static org.apache.poi.hssf.record.Record [] createRecord(RecordInputStream in) { | |||
Record record = createSingleRecord(in); | |||
if (record instanceof DBCellRecord) { | |||
// Not needed by POI. Regenerated from scratch by POI when spreadsheet is written | |||
@@ -329,7 +329,7 @@ public final class RecordFactory { | |||
return new Record[] { record, }; | |||
} | |||
public static Record createSingleRecord(RecordInputStream in) { | |||
public static org.apache.poi.hssf.record.Record createSingleRecord(RecordInputStream in) { | |||
I_RecordCreator constructor = _recordCreatorsById.get(Integer.valueOf(in.getSid())); | |||
if (constructor == null) { | |||
@@ -478,9 +478,9 @@ public final class RecordFactory { | |||
* | |||
* @exception org.apache.poi.util.RecordFormatException on error processing the InputStream | |||
*/ | |||
public static List<Record> createRecords(InputStream in) throws org.apache.poi.util.RecordFormatException { | |||
public static List<org.apache.poi.hssf.record.Record> createRecords(InputStream in) throws org.apache.poi.util.RecordFormatException { | |||
List<Record> records = new ArrayList<>(NUM_RECORDS); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(NUM_RECORDS); | |||
RecordFactoryInputStream recStream = new RecordFactoryInputStream(in, true); | |||
@@ -52,7 +52,7 @@ public final class RecordFactoryInputStream { | |||
private final Record _lastRecord; | |||
private final boolean _hasBOFRecord; | |||
public StreamEncryptionInfo(RecordInputStream rs, List<Record> outputRecs) { | |||
public StreamEncryptionInfo(RecordInputStream rs, List<org.apache.poi.hssf.record.Record> outputRecs) { | |||
Record rec; | |||
rs.nextRecord(); | |||
int recSize = 4 + rs.remaining(); | |||
@@ -183,7 +183,7 @@ public final class RecordFactoryInputStream { | |||
*/ | |||
public RecordFactoryInputStream(InputStream in, boolean shouldIncludeContinueRecords) { | |||
RecordInputStream rs = new RecordInputStream(in); | |||
List<Record> records = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
StreamEncryptionInfo sei = new StreamEncryptionInfo(rs, records); | |||
if (sei.hasEncryption()) { | |||
rs = sei.createDecryptingStream(in); |
@@ -57,7 +57,7 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate { | |||
temp.add(rs.getNext()); | |||
} | |||
_recs = temp; | |||
Record eof = rs.getNext(); // no need to save EOF in field | |||
org.apache.poi.hssf.record.Record eof = rs.getNext(); // no need to save EOF in field | |||
if (!(eof instanceof EOFRecord)) { | |||
throw new IllegalStateException("Bad chart EOF"); | |||
} | |||
@@ -73,7 +73,7 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate { | |||
if (rb instanceof RecordAggregate) { | |||
((RecordAggregate) rb).visitContainedRecords(rv); | |||
} else { | |||
rv.visitRecord((Record) rb); | |||
rv.visitRecord((org.apache.poi.hssf.record.Record) rb); | |||
} | |||
} | |||
rv.visitRecord(EOFRecord.instance); |
@@ -29,8 +29,8 @@ import org.apache.poi.hssf.record.*; | |||
*/ | |||
public final class CustomViewSettingsRecordAggregate extends RecordAggregate { | |||
private final Record _begin; | |||
private final Record _end; | |||
private final org.apache.poi.hssf.record.Record _begin; | |||
private final org.apache.poi.hssf.record.Record _end; | |||
/** | |||
* All the records between BOF and EOF | |||
*/ | |||
@@ -77,7 +77,7 @@ public final class CustomViewSettingsRecordAggregate extends RecordAggregate { | |||
if (rb instanceof RecordAggregate) { | |||
((RecordAggregate) rb).visitContainedRecords(rv); | |||
} else { | |||
rv.visitRecord((Record) rb); | |||
rv.visitRecord((org.apache.poi.hssf.record.Record) rb); | |||
} | |||
} | |||
rv.visitRecord(_end); |
@@ -40,7 +40,7 @@ public final class PageSettingsBlock extends RecordAggregate { | |||
*/ | |||
private static final class PLSAggregate extends RecordAggregate { | |||
private static final ContinueRecord[] EMPTY_CONTINUE_RECORD_ARRAY = { }; | |||
private final Record _pls; | |||
private final org.apache.poi.hssf.record.Record _pls; | |||
/** | |||
* holds any continue records found after the PLS record.<br> | |||
* This would not be required if PLS was properly interpreted. | |||
@@ -86,7 +86,7 @@ public final class PageSettingsBlock extends RecordAggregate { | |||
private BottomMarginRecord _bottomMargin; | |||
private final List<PLSAggregate> _plsRecords; | |||
private PrintSetupRecord _printSetup; | |||
private Record _bitmap; | |||
private org.apache.poi.hssf.record.Record _bitmap; | |||
private HeaderFooterRecord _headerFooter; | |||
/** | |||
* HeaderFooterRecord records belonging to preceding CustomViewSettingsRecordAggregates. | |||
@@ -94,7 +94,7 @@ public final class PageSettingsBlock extends RecordAggregate { | |||
* see {@link org.apache.poi.hssf.record.HeaderFooterRecord#getGuid()} | |||
*/ | |||
private final List<HeaderFooterRecord> _sviewHeaderFooters = new ArrayList<>(); | |||
private Record _printSize; | |||
private org.apache.poi.hssf.record.Record _printSize; | |||
public PageSettingsBlock(RecordStream rs) { | |||
_plsRecords = new ArrayList<>(); | |||
@@ -220,7 +220,7 @@ public final class PageSettingsBlock extends RecordAggregate { | |||
return true; | |||
} | |||
private void checkNotPresent(Record rec) { | |||
private void checkNotPresent(org.apache.poi.hssf.record.Record rec) { | |||
if (rec != null) { | |||
throw new org.apache.poi.util.RecordFormatException("Duplicate PageSettingsBlock record (sid=0x" | |||
+ Integer.toHexString(rec.getSid()) + ")"); | |||
@@ -296,7 +296,7 @@ public final class PageSettingsBlock extends RecordAggregate { | |||
visitIfPresent(_headerFooter, rv); | |||
visitIfPresent(_bitmap, rv); | |||
} | |||
private static void visitIfPresent(Record r, RecordVisitor rv) { | |||
private static void visitIfPresent(org.apache.poi.hssf.record.Record r, RecordVisitor rv) { | |||
if (r != null) { | |||
rv.visitRecord(r); | |||
} | |||
@@ -687,7 +687,7 @@ public final class PageSettingsBlock extends RecordAggregate { | |||
final CustomViewSettingsRecordAggregate cv = (CustomViewSettingsRecordAggregate) rb; | |||
cv.visitContainedRecords(new RecordVisitor() { | |||
@Override | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
if (r.getSid() == UserSViewBegin.sid) { | |||
String guid = HexDump.toHex(((UserSViewBegin) r).getGuid()); | |||
HeaderFooterRecord hf = hfGuidMap.get(guid); |
@@ -53,7 +53,7 @@ public abstract class RecordAggregate extends RecordBase { | |||
* Implementors may call non-mutating methods on Record r. | |||
* @param r must not be <code>null</code> | |||
*/ | |||
void visitRecord(Record r); | |||
void visitRecord(org.apache.poi.hssf.record.Record r); | |||
} | |||
private static final class SerializingRecordVisitor implements RecordVisitor { | |||
@@ -70,7 +70,7 @@ public abstract class RecordAggregate extends RecordBase { | |||
public int countBytesWritten() { | |||
return _countBytesWritten; | |||
} | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
int currentOffset = _startOffset + _countBytesWritten; | |||
_countBytesWritten += r.serialize(currentOffset, _data); | |||
} | |||
@@ -85,7 +85,7 @@ public abstract class RecordAggregate extends RecordBase { | |||
public int getTotalSize() { | |||
return _totalSize; | |||
} | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
_totalSize += r.getRecordSize(); | |||
} | |||
} | |||
@@ -101,7 +101,7 @@ public abstract class RecordAggregate extends RecordBase { | |||
_rv = rv; | |||
_position = initialPosition; | |||
} | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
_position += r.getRecordSize(); | |||
_rv.visitRecord(r); | |||
} |
@@ -52,7 +52,7 @@ public final class RowRecordsAggregate extends RecordAggregate { | |||
private int _lastrow = -1; | |||
private final Map<Integer, RowRecord> _rowRecords; | |||
private final ValueRecordsAggregate _valuesAgg; | |||
private final List<Record> _unknownRecords; | |||
private final List<org.apache.poi.hssf.record.Record> _unknownRecords; | |||
private final SharedValueManager _sharedValueManager; | |||
// Cache values to speed up performance of | |||
@@ -116,7 +116,7 @@ public final class RowRecordsAggregate extends RecordAggregate { | |||
/** | |||
* Handles UnknownRecords which appear within the row/cell records | |||
*/ | |||
private void addUnknownRecord(Record rec) { | |||
private void addUnknownRecord(org.apache.poi.hssf.record.Record rec) { | |||
// ony a few distinct record IDs are encountered by the existing POI test cases: | |||
// 0x1065 // many | |||
// 0x01C2 // several |
@@ -251,7 +251,7 @@ public final class ValueRecordsAggregate implements Iterable<CellValueRecordInte | |||
RecordAggregate agg = (RecordAggregate) cvr; | |||
agg.visitContainedRecords(rv); | |||
} else { | |||
rv.visitRecord((Record) cvr); | |||
rv.visitRecord((org.apache.poi.hssf.record.Record) cvr); | |||
} | |||
} | |||
} |
@@ -90,7 +90,7 @@ public final class WorksheetProtectionBlock extends RecordAggregate { | |||
return true; | |||
} | |||
private void checkNotPresent(Record rec) { | |||
private void checkNotPresent(org.apache.poi.hssf.record.Record rec) { | |||
if (rec != null) { | |||
throw new RecordFormatException("Duplicate PageSettingsBlock record (sid=0x" | |||
+ Integer.toHexString(rec.getSid()) + ")"); | |||
@@ -106,7 +106,7 @@ public final class WorksheetProtectionBlock extends RecordAggregate { | |||
visitIfPresent(_passwordRecord, rv); | |||
} | |||
private static void visitIfPresent(Record r, RecordVisitor rv) { | |||
private static void visitIfPresent(org.apache.poi.hssf.record.Record r, RecordVisitor rv) { | |||
if (r != null) { | |||
rv.visitRecord(r); | |||
} |
@@ -113,7 +113,7 @@ public final class HSSFChart { | |||
public void createBarChart( HSSFWorkbook workbook, HSSFSheet parentSheet ) | |||
{ | |||
List<Record> records = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
records.add( createMSDrawingObjectRecord() ); | |||
records.add( createOBJRecord() ); | |||
records.add( createBOFRecord() ); | |||
@@ -227,7 +227,7 @@ public final class HSSFChart { | |||
} else if(r instanceof ValueRangeRecord){ | |||
lastChart.valueRanges.add((ValueRangeRecord)r); | |||
} else if (r instanceof Record) { | |||
Record record = (Record) r; | |||
Record record = (org.apache.poi.hssf.record.Record) r; | |||
for (HSSFChartType type : HSSFChartType.values()) { | |||
if (type == HSSFChartType.Unknown) { | |||
continue; | |||
@@ -440,7 +440,7 @@ public final class HSSFChart { | |||
return new UnknownRecord((short)0x00EC, data); | |||
} | |||
private void createAxisRecords( List<Record> records ) | |||
private void createAxisRecords( List<org.apache.poi.hssf.record.Record> records ) | |||
{ | |||
records.add( createAxisParentRecord() ); | |||
records.add( createBeginRecord() ); | |||
@@ -1244,7 +1244,7 @@ public final class HSSFChart { | |||
} | |||
newRecord = seriesTextRecord; | |||
} else if (record instanceof Record) { | |||
newRecord = (Record) ((Record)record).copy(); | |||
newRecord = (org.apache.poi.hssf.record.Record) ((org.apache.poi.hssf.record.Record)record).copy(); | |||
} | |||
if (newRecord != null) |
@@ -231,7 +231,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { | |||
} | |||
if (log.check( POILogger.DEBUG )) { | |||
if (cval instanceof Record) { | |||
log.log( DEBUG, "record id = " + Integer.toHexString( ( (Record) cval ).getSid() ) ); | |||
log.log( DEBUG, "record id = " + Integer.toHexString( ( (org.apache.poi.hssf.record.Record) cval ).getSid() ) ); | |||
} else { | |||
log.log( DEBUG, "record = " + cval ); | |||
} | |||
@@ -438,7 +438,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { | |||
private HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(getWorkbook()); | |||
@Override | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
if (!(r instanceof DVRecord)) { | |||
return; | |||
} | |||
@@ -1773,7 +1773,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { | |||
// add logic for hyperlinks etc, like in shiftRows() | |||
} | |||
protected void insertChartRecords(List<Record> records) { | |||
protected void insertChartRecords(List<org.apache.poi.hssf.record.Record> records) { | |||
int window2Loc = _sheet.findFirstRecordLocBySid(WindowTwoRecord.sid); | |||
_sheet.getRecords().addAll(window2Loc, records); | |||
} |
@@ -340,7 +340,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss | |||
// it happens to be spelled. | |||
InputStream stream = directory.createDocumentInputStream(workbookName); | |||
List<Record> records = RecordFactory.createRecords(stream); | |||
List<org.apache.poi.hssf.record.Record> records = RecordFactory.createRecords(stream); | |||
workbook = InternalWorkbook.createWorkbook(records); | |||
setPropertiesFromWorkbook(workbook); | |||
@@ -428,7 +428,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss | |||
* @see org.apache.poi.hssf.record.SSTRecord | |||
*/ | |||
private void convertLabelRecords(List<Record> records, int offset) | |||
private void convertLabelRecords(List<org.apache.poi.hssf.record.Record> records, int offset) | |||
{ | |||
if (log.check( POILogger.DEBUG )) { | |||
log.log(POILogger.DEBUG, "convertLabelRecords called"); | |||
@@ -1419,7 +1419,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss | |||
*/ | |||
private static final class SheetRecordCollector implements RecordVisitor { | |||
private List<Record> _list; | |||
private List<org.apache.poi.hssf.record.Record> _list; | |||
private int _totalSize; | |||
public SheetRecordCollector() { | |||
@@ -1430,14 +1430,14 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss | |||
return _totalSize; | |||
} | |||
@Override | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
_list.add(r); | |||
_totalSize+=r.getRecordSize(); | |||
} | |||
public int serialize(int offset, byte[] data) { | |||
int result = 0; | |||
for (Record rec : _list) { | |||
for (org.apache.poi.hssf.record.Record rec : _list) { | |||
result += rec.serialize(offset + result, data); | |||
} | |||
return result; | |||
@@ -1952,7 +1952,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss | |||
{ | |||
// The drawing group record always exists at the top level, so we won't need to do this recursively. | |||
List<HSSFPictureData> pictures = new ArrayList<>(); | |||
for (Record r : workbook.getRecords()) { | |||
for (org.apache.poi.hssf.record.Record r : workbook.getRecords()) { | |||
if (r instanceof AbstractEscherHolderRecord) { | |||
((AbstractEscherHolderRecord) r).decode(); | |||
List<EscherRecord> escherRecords = ((AbstractEscherHolderRecord) r).getEscherRecords(); |
@@ -75,7 +75,7 @@ public final class SlideIdListing { | |||
SlideListWithText[] slwts = document.getSlideListWithTexts(); | |||
for (SlideListWithText slwt : slwts) { | |||
Record[] cr = slwt.getChildRecords(); | |||
for (Record record : cr) { | |||
for (org.apache.poi.hslf.record.Record record : cr) { | |||
if (record instanceof SlidePersistAtom) { | |||
SlidePersistAtom spa = (SlidePersistAtom) record; | |||
System.out.println("SlidePersistAtom knows about slide:"); | |||
@@ -117,7 +117,7 @@ public final class SlideIdListing { | |||
// Find any persist ones first | |||
int pos = 0; | |||
for (Record r : records) { | |||
for (org.apache.poi.hslf.record.Record r : records) { | |||
if (r.getRecordType() == 6001L) { | |||
// PersistPtrFullBlock | |||
System.out.println("Found PersistPtrFullBlock at " + pos + " (" + Integer.toHexString(pos) + ")"); | |||
@@ -159,7 +159,7 @@ public final class SlideIdListing { | |||
// Finds the record at a given position | |||
public static Record findRecordAtPos(int pos) { | |||
public static org.apache.poi.hslf.record.Record findRecordAtPos(int pos) { | |||
long type = LittleEndian.getUShort(fileContents, pos+2); | |||
long rlen = LittleEndian.getUInt(fileContents, pos+4); | |||
@@ -146,7 +146,7 @@ public final class SlideShowRecordDumper { | |||
return ret.toString(); | |||
} | |||
public int getDiskLen(Record r) throws IOException { | |||
public int getDiskLen(org.apache.poi.hslf.record.Record r) throws IOException { | |||
int diskLen = 0; | |||
if (r != null) { | |||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
@@ -156,7 +156,7 @@ public final class SlideShowRecordDumper { | |||
return diskLen; | |||
} | |||
public String getPrintableRecordContents(Record r) throws IOException { | |||
public String getPrintableRecordContents(org.apache.poi.hslf.record.Record r) throws IOException { | |||
if (r == null) { | |||
return "<<null>>"; | |||
} | |||
@@ -228,7 +228,7 @@ public final class SlideShowRecordDumper { | |||
public void walkTree(int depth, int pos, Record[] records, int indent) throws IOException { | |||
String ind = tabs.substring(0, indent); | |||
for (Record r : records) { | |||
for (org.apache.poi.hslf.record.Record r : records) { | |||
if (r == null) { | |||
ps.println(ind + "At position " + pos + " (" + makeHex(pos, 6) + "):"); | |||
ps.println(ind + "Warning! Null record found."); |
@@ -44,7 +44,7 @@ public final class TextStyleListing { | |||
try (HSLFSlideShowImpl ss = new HSLFSlideShowImpl(args[0])) { | |||
// Find the documents, and then their SLWT | |||
Record[] records = ss.getRecords(); | |||
for (Record record : records) { | |||
for (org.apache.poi.hslf.record.Record record : records) { | |||
if (record.getRecordType() == 1000L) { | |||
Record[] docChildren = record.getChildRecords(); | |||
for (Record docChild : docChildren) { |
@@ -50,7 +50,7 @@ public final class UserEditAndPersistListing { | |||
// Find any persist ones first | |||
int pos = 0; | |||
for (Record r : ss.getRecords()) { | |||
for (org.apache.poi.hslf.record.Record r : ss.getRecords()) { | |||
if (r.getRecordType() == 6001L) { | |||
// PersistPtrFullBlock | |||
System.out.println("Found PersistPtrFullBlock at " + pos + " (" + Integer.toHexString(pos) + ")"); | |||
@@ -88,7 +88,7 @@ public final class UserEditAndPersistListing { | |||
pos = 0; | |||
// Now look for UserEditAtoms | |||
for (Record r : ss.getRecords()) { | |||
for (org.apache.poi.hslf.record.Record r : ss.getRecords()) { | |||
if (r instanceof UserEditAtom) { | |||
UserEditAtom uea = (UserEditAtom) r; | |||
System.out.println("Found UserEditAtom at " + pos + " (" + Integer.toHexString(pos) + ")"); | |||
@@ -118,7 +118,7 @@ public final class UserEditAndPersistListing { | |||
// Finds the record at a given position | |||
public static Record findRecordAtPos(int pos) { | |||
public static org.apache.poi.hslf.record.Record findRecordAtPos(int pos) { | |||
long type = LittleEndian.getUShort(fileContents, pos+2); | |||
long rlen = LittleEndian.getUInt(fileContents, pos+4); | |||
@@ -71,7 +71,7 @@ public final class AnimationInfo extends RecordContainer { | |||
_header[0] = 0x0f; // We are a container record | |||
LittleEndian.putShort(_header, 2, (short)getRecordType()); | |||
_children = new Record[1]; | |||
_children = new org.apache.poi.hslf.record.Record[1]; | |||
_children[0] = animationAtom = new AnimationInfoAtom(); | |||
} | |||
@@ -105,7 +105,7 @@ public final class Comment2000 extends RecordContainer { | |||
System.arraycopy(source,start,_header,0,8); | |||
// Find our children | |||
_children = Record.findChildRecords(source,start+8,len-8); | |||
_children = org.apache.poi.hslf.record.Record.findChildRecords(source,start+8,len-8); | |||
findInterestingChildren(); | |||
} | |||
@@ -116,7 +116,7 @@ public final class Comment2000 extends RecordContainer { | |||
*/ | |||
private void findInterestingChildren() { | |||
for(Record r : _children){ | |||
for(org.apache.poi.hslf.record.Record r : _children){ | |||
if (r instanceof CString){ | |||
CString cs = (CString)r; | |||
int recInstance = cs.getOptions() >> 4; | |||
@@ -140,7 +140,7 @@ public final class Comment2000 extends RecordContainer { | |||
*/ | |||
public Comment2000() { | |||
_header = new byte[8]; | |||
_children = new Record[4]; | |||
_children = new org.apache.poi.hslf.record.Record[4]; | |||
// Setup our header block | |||
_header[0] = 0x0f; // We are a container record |
@@ -60,7 +60,7 @@ public final class DocInfoListContainer extends RecordContainer { | |||
*/ | |||
private DocInfoListContainer() { | |||
_header = new byte[8]; | |||
_children = new Record[0]; | |||
_children = new org.apache.poi.hslf.record.Record[0]; | |||
// Setup our header block | |||
_header[0] = 0x0f; // We are a container record |
@@ -57,7 +57,7 @@ public final class EscherTextboxWrapper extends RecordContainer { | |||
// Find the child records in the escher data | |||
byte[] data = _escherRecord.getData(); | |||
_children = Record.findChildRecords(data,0,data.length); | |||
for (Record r : this._children) { | |||
for (org.apache.poi.hslf.record.Record r : this._children) { | |||
if (r instanceof StyleTextPropAtom) { this.styleTextPropAtom = (StyleTextPropAtom) r; } | |||
} | |||
} | |||
@@ -70,7 +70,7 @@ public final class EscherTextboxWrapper extends RecordContainer { | |||
_escherRecord.setRecordId(EscherTextboxRecord.RECORD_ID); | |||
_escherRecord.setOptions((short)15); | |||
_children = new Record[0]; | |||
_children = new org.apache.poi.hslf.record.Record[0]; | |||
} | |||
@@ -90,7 +90,7 @@ public final class EscherTextboxWrapper extends RecordContainer { | |||
// Grab the children's data | |||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
for (Record r : _children) r.writeOut(baos); | |||
for (org.apache.poi.hslf.record.Record r : _children) r.writeOut(baos); | |||
byte[] data = baos.toByteArray(); | |||
// Save in the escher layer |
@@ -34,7 +34,7 @@ public class ExEmbed extends RecordContainer { | |||
private final byte[] _header; | |||
// Links to our more interesting children | |||
private RecordAtom embedAtom; | |||
public org.apache.poi.hslf.record.RecordAtom embedAtom; | |||
private ExOleObjAtom oleObjAtom; | |||
private CString menuName; | |||
private CString progId; | |||
@@ -74,7 +74,7 @@ public class ExEmbed extends RecordContainer { | |||
*/ | |||
public ExEmbed() { | |||
_header = new byte[8]; | |||
_children = new Record[5]; | |||
_children = new org.apache.poi.hslf.record.Record[5]; | |||
// Setup our header block | |||
_header[0] = 0x0f; // We are a container record | |||
@@ -222,7 +222,7 @@ public class ExEmbed extends RecordContainer { | |||
} | |||
boolean found = false; | |||
for (final Record r : _children) { | |||
for (final org.apache.poi.hslf.record.Record r : _children) { | |||
// for simplicity just check for object identity | |||
if (r == newStr) { | |||
found = true; |
@@ -137,7 +137,7 @@ public class ExHyperlink extends RecordContainer { | |||
*/ | |||
public ExHyperlink() { | |||
_header = new byte[8]; | |||
_children = new Record[3]; | |||
_children = new org.apache.poi.hslf.record.Record[3]; | |||
// Setup our header block | |||
_header[0] = 0x0f; // We are a container record |
@@ -57,7 +57,7 @@ public class ExMCIMovie extends RecordContainer { // TODO - instantiable supercl | |||
LittleEndian.putShort(_header, 2, (short) getRecordType()); | |||
exVideo = new ExVideoContainer(); | |||
_children = new Record[]{exVideo}; | |||
_children = new org.apache.poi.hslf.record.Record[]{exVideo}; | |||
} | |||
@@ -85,7 +85,7 @@ public class ExObjList extends RecordContainer { | |||
*/ | |||
public ExObjList() { | |||
_header = new byte[8]; | |||
_children = new Record[1]; | |||
_children = new org.apache.poi.hslf.record.Record[1]; | |||
// Setup our header block | |||
_header[0] = 0x0f; // We are a container record |
@@ -78,7 +78,7 @@ public final class ExVideoContainer extends RecordContainer { | |||
_header[0] = 0x0f; // We are a container record | |||
LittleEndian.putShort(_header, 2, (short)getRecordType()); | |||
_children = new Record[2]; | |||
_children = new org.apache.poi.hslf.record.Record[2]; | |||
_children[0] = mediaAtom = new ExMediaAtom(); | |||
_children[1] = pathAtom = new CString(); | |||
} |
@@ -52,7 +52,7 @@ public final class FontCollection extends RecordContainer { | |||
_children = Record.findChildRecords(source,start+8,len-8); | |||
for (Record r : _children){ | |||
for (org.apache.poi.hslf.record.Record r : _children){ | |||
if(r instanceof FontEntityAtom) { | |||
HSLFFontInfo fi = new HSLFFontInfo((FontEntityAtom) r); | |||
fonts.put(fi.getIndex(), fi); |
@@ -41,7 +41,7 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord { | |||
//arbitrarily selected; may need to increase | |||
private static final int MAX_RECORD_LENGTH = 1_000_000; | |||
private final List<Record> _childRecords = new ArrayList<>(); | |||
private final List<org.apache.poi.hslf.record.Record> _childRecords = new ArrayList<>(); | |||
public HSLFEscherClientDataRecord() {} | |||
@@ -99,7 +99,7 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord { | |||
public byte[] getRemainingData() { | |||
ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |||
try { | |||
for (Record r : _childRecords) { | |||
for (org.apache.poi.hslf.record.Record r : _childRecords) { | |||
r.writeOut(bos); | |||
} | |||
} catch (IOException e) { | |||
@@ -113,7 +113,7 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord { | |||
_childRecords.clear(); | |||
int offset = 0; | |||
while (offset < remainingData.length) { | |||
final Record r = Record.buildRecordAtOffset(remainingData, offset); | |||
final org.apache.poi.hslf.record.Record r = Record.buildRecordAtOffset(remainingData, offset); | |||
if (r != null) { | |||
_childRecords.add(r); | |||
} |
@@ -104,7 +104,7 @@ public final class HeadersFootersContainer extends RecordContainer { | |||
LittleEndian.putShort(_header, 2, (short)getRecordType()); | |||
hdAtom = new HeadersFootersAtom(); | |||
_children = new Record[]{ | |||
_children = new org.apache.poi.hslf.record.Record[]{ | |||
hdAtom | |||
}; | |||
csDate = csHeader = csFooter = null; | |||
@@ -198,7 +198,7 @@ public final class HeadersFootersContainer extends RecordContainer { | |||
csHeader = new CString(); | |||
csHeader.setOptions(HEADERATOM << 4); | |||
Record r = hdAtom; | |||
org.apache.poi.hslf.record.Record r = hdAtom; | |||
if(csDate != null) r = hdAtom; | |||
addChildAfter(csHeader, r); | |||
@@ -216,7 +216,7 @@ public final class HeadersFootersContainer extends RecordContainer { | |||
csFooter = new CString(); | |||
csFooter.setOptions(FOOTERATOM << 4); | |||
Record r = hdAtom; | |||
org.apache.poi.hslf.record.Record r = hdAtom; | |||
if(csHeader != null) r = csHeader; | |||
else if(csDate != null) r = csDate; | |||
addChildAfter(csFooter, r); |
@@ -73,7 +73,7 @@ public class InteractiveInfo extends RecordContainer { | |||
*/ | |||
public InteractiveInfo() { | |||
_header = new byte[8]; | |||
_children = new Record[1]; | |||
_children = new org.apache.poi.hslf.record.Record[1]; | |||
// Setup our header block | |||
_header[0] = 0x0f; // We are a container record |
@@ -168,7 +168,7 @@ public final class PPDrawing extends RecordAtom implements Iterable<EscherRecord | |||
findFirst(); | |||
} | |||
private static Stream<StyleTextProp9Atom> findInProgBinaryTag(Record r) { | |||
private static Stream<StyleTextProp9Atom> findInProgBinaryTag(org.apache.poi.hslf.record.Record r) { | |||
Record[] ch = r.getChildRecords(); | |||
if (ch != null && | |||
ch.length == 2 && | |||
@@ -253,7 +253,7 @@ public final class PPDrawing extends RecordAtom implements Iterable<EscherRecord | |||
/** | |||
* We're pretending to be an atom, so return null | |||
*/ | |||
public Record[] getChildRecords() { return null; } | |||
public org.apache.poi.hslf.record.Record[] getChildRecords() { return null; } | |||
/** | |||
* Write the contents of the record back, so it can be written | |||
@@ -396,7 +396,7 @@ public final class PPDrawing extends RecordAtom implements Iterable<EscherRecord | |||
return GenericRecordUtil.getGenericProperties("escherRecords", this::getEscherRecords); | |||
} | |||
private static Predicate<Record> sameHSLF(RecordTypes type) { | |||
private static Predicate<org.apache.poi.hslf.record.Record> sameHSLF(RecordTypes type) { | |||
return (p) -> p.getRecordType() == type.typeID; | |||
} | |||
@@ -73,7 +73,7 @@ public final class PPDrawingGroup extends RecordAtom { | |||
/** | |||
* We're pretending to be an atom, so return null | |||
*/ | |||
public Record[] getChildRecords() { | |||
public org.apache.poi.hslf.record.Record[] getChildRecords() { | |||
return null; | |||
} | |||
@@ -24,6 +24,6 @@ package org.apache.poi.hslf.record; | |||
* @author Nick Burch (nick at torchbox dot com) | |||
*/ | |||
public interface ParentAwareRecord { | |||
public RecordContainer getParentRecord(); | |||
public org.apache.poi.hslf.record.RecordContainer getParentRecord(); | |||
public void setParentRecord(RecordContainer parentRecord); | |||
} |
@@ -79,7 +79,7 @@ public abstract class Record implements GenericRecord | |||
} | |||
@Override | |||
public List<Record> getGenericChildren() { | |||
public List<org.apache.poi.hslf.record.Record> getGenericChildren() { | |||
Record[] recs = getChildRecords(); | |||
return (recs == null) ? null : Arrays.asList(recs); | |||
} | |||
@@ -107,7 +107,7 @@ public abstract class Record implements GenericRecord | |||
* @param b The byte array to build from | |||
* @param offset The offset to build at | |||
*/ | |||
public static Record buildRecordAtOffset(byte[] b, int offset) { | |||
public static org.apache.poi.hslf.record.Record buildRecordAtOffset(byte[] b, int offset) { | |||
long type = LittleEndian.getUShort(b,offset+2); | |||
long rlen = LittleEndian.getUInt(b,offset+4); | |||
@@ -122,7 +122,7 @@ public abstract class Record implements GenericRecord | |||
* Default method for finding child records of a container record | |||
*/ | |||
public static Record[] findChildRecords(byte[] b, int start, int len) { | |||
List<Record> children = new ArrayList<>(5); | |||
List<org.apache.poi.hslf.record.Record> children = new ArrayList<>(5); | |||
// Jump our little way along, creating records as we go | |||
int pos = start; | |||
@@ -149,7 +149,7 @@ public abstract class Record implements GenericRecord | |||
} | |||
// Turn the vector into an array, and return | |||
return children.toArray(new Record[0]); | |||
return children.toArray(new org.apache.poi.hslf.record.Record[0]); | |||
} | |||
/** | |||
@@ -161,7 +161,7 @@ public abstract class Record implements GenericRecord | |||
* (not including the size of the header), this code assumes you're | |||
* passing in corrected lengths | |||
*/ | |||
public static Record createRecordForType(long type, byte[] b, int start, int len) { | |||
public static org.apache.poi.hslf.record.Record createRecordForType(long type, byte[] b, int start, int len) { | |||
// We use the RecordTypes class to provide us with the right | |||
// class to use for a given type | |||
// A spot of reflection gets us the (byte[],int,int) constructor |
@@ -33,5 +33,5 @@ public abstract class RecordAtom extends Record | |||
/** | |||
* We're an atom, returns null | |||
*/ | |||
public Record[] getChildRecords() { return null; } | |||
public org.apache.poi.hslf.record.Record[] getChildRecords() { return null; } | |||
} |
@@ -42,7 +42,7 @@ public abstract class RecordContainer extends Record | |||
* Return any children | |||
*/ | |||
@Override | |||
public Record[] getChildRecords() { return _children; } | |||
public org.apache.poi.hslf.record.Record[] getChildRecords() { return _children; } | |||
/** | |||
* We're not an atom | |||
@@ -61,7 +61,7 @@ public abstract class RecordContainer extends Record | |||
*/ | |||
private int findChildLocation(Record child) { | |||
int i=0; | |||
for(Record r : _children) { | |||
for(org.apache.poi.hslf.record.Record r : _children) { | |||
if (r.equals(child)) { | |||
return i; | |||
} | |||
@@ -77,7 +77,7 @@ public abstract class RecordContainer extends Record | |||
*/ | |||
private int appendChild(Record newChild) { | |||
// Copy over, and pop the child in at the end | |||
Record[] nc = new Record[(_children.length + 1)]; | |||
Record[] nc = new org.apache.poi.hslf.record.Record[(_children.length + 1)]; | |||
System.arraycopy(_children, 0, nc, 0, _children.length); | |||
// Switch the arrays | |||
nc[_children.length] = newChild; | |||
@@ -125,8 +125,8 @@ public abstract class RecordContainer extends Record | |||
* or null if none of the child records are of the | |||
* given type. Does not descend. | |||
*/ | |||
public Record findFirstOfType(long type) { | |||
for (Record r : _children) { | |||
public org.apache.poi.hslf.record.Record findFirstOfType(long type) { | |||
for (org.apache.poi.hslf.record.Record r : _children) { | |||
if (r.getRecordType() == type) { | |||
return r; | |||
} | |||
@@ -140,17 +140,17 @@ public abstract class RecordContainer extends Record | |||
* @param ch the child to remove | |||
* @return the removed record | |||
*/ | |||
public Record removeChild(Record ch) { | |||
Record rm = null; | |||
ArrayList<Record> lst = new ArrayList<>(); | |||
for(Record r : _children) { | |||
public org.apache.poi.hslf.record.Record removeChild(Record ch) { | |||
org.apache.poi.hslf.record.Record rm = null; | |||
ArrayList<org.apache.poi.hslf.record.Record> lst = new ArrayList<>(); | |||
for(org.apache.poi.hslf.record.Record r : _children) { | |||
if(r != ch) { | |||
lst.add(r); | |||
} else { | |||
rm = r; | |||
} | |||
} | |||
_children = lst.toArray(new Record[0]); | |||
_children = lst.toArray(new org.apache.poi.hslf.record.Record[0]); | |||
return rm; | |||
} | |||
@@ -278,7 +278,7 @@ public abstract class RecordContainer extends Record | |||
* | |||
* @param records the new child records | |||
*/ | |||
public void setChildRecord(Record[] records) { | |||
public void setChildRecord(org.apache.poi.hslf.record.Record[] records) { | |||
this._children = records.clone(); | |||
} | |||
@@ -360,7 +360,7 @@ public abstract class RecordContainer extends Record | |||
*/ | |||
public static void handleParentAwareRecords(RecordContainer br) { | |||
// Loop over child records, looking for interesting ones | |||
for (Record record : br.getChildRecords()) { | |||
for (org.apache.poi.hslf.record.Record record : br.getChildRecords()) { | |||
// Tell parent aware records of their parent | |||
if (record instanceof ParentAwareRecord) { | |||
((ParentAwareRecord) record).setParentRecord(br); |
@@ -92,7 +92,7 @@ public final class Slide extends SheetContainer | |||
ColorSchemeAtom colorAtom = new ColorSchemeAtom(); | |||
_children = new Record[] { | |||
_children = new org.apache.poi.hslf.record.Record[] { | |||
slideAtom, | |||
ppDrawing, | |||
colorAtom |
@@ -96,7 +96,7 @@ public final class SlideListWithText extends RecordContainer { | |||
// Create a SlideAtomsSets, not caring if they're empty | |||
//if(emptySet) { continue; } | |||
Record[] spaChildren = new Record[clen]; | |||
org.apache.poi.hslf.record.Record[] spaChildren = new org.apache.poi.hslf.record.Record[clen]; | |||
System.arraycopy(_children,i+1,spaChildren,0,clen); | |||
SlideAtomsSet set = new SlideAtomsSet((SlidePersistAtom)_children[i],spaChildren); | |||
sets.add(set); | |||
@@ -120,7 +120,7 @@ public final class SlideListWithText extends RecordContainer { | |||
LittleEndian.putInt(_header, 4, 0); | |||
// We have no children to start with | |||
_children = new Record[0]; | |||
_children = new org.apache.poi.hslf.record.Record[0]; | |||
slideAtomsSets = new SlideAtomsSet[0]; | |||
} | |||
@@ -133,7 +133,7 @@ public final class SlideListWithText extends RecordContainer { | |||
// Add the new SlidePersistAtom at the end | |||
appendChildRecord(spa); | |||
SlideAtomsSet newSAS = new SlideAtomsSet(spa, new Record[0]); | |||
SlideAtomsSet newSAS = new SlideAtomsSet(spa, new org.apache.poi.hslf.record.Record[0]); | |||
// Update our SlideAtomsSets with this | |||
SlideAtomsSet[] sas = new SlideAtomsSet[slideAtomsSets.length+1]; | |||
@@ -186,15 +186,15 @@ public final class SlideListWithText extends RecordContainer { | |||
*/ | |||
public static class SlideAtomsSet { | |||
private SlidePersistAtom slidePersistAtom; | |||
private Record[] slideRecords; | |||
private org.apache.poi.hslf.record.Record[] slideRecords; | |||
/** Get the SlidePersistAtom, which gives details on the Slide this text is associated with */ | |||
public SlidePersistAtom getSlidePersistAtom() { return slidePersistAtom; } | |||
/** Get the Text related records for this slide */ | |||
public Record[] getSlideRecords() { return slideRecords; } | |||
public org.apache.poi.hslf.record.Record[] getSlideRecords() { return slideRecords; } | |||
/** Create one to hold the Records for one Slide's text */ | |||
public SlideAtomsSet(SlidePersistAtom s, Record[] r) { | |||
public SlideAtomsSet(SlidePersistAtom s, org.apache.poi.hslf.record.Record[] r) { | |||
slidePersistAtom = s; | |||
slideRecords = r.clone(); | |||
} |
@@ -36,7 +36,7 @@ import org.apache.poi.util.LittleEndian; | |||
public final class TextHeaderAtom extends RecordAtom implements ParentAwareRecord { | |||
public static final long _type = RecordTypes.TextHeaderAtom.typeID; | |||
private byte[] _header; | |||
private RecordContainer parentRecord; | |||
public org.apache.poi.hslf.record.RecordContainer parentRecord; | |||
/** The kind of text it is */ | |||
private int textType; | |||
@@ -65,7 +65,7 @@ public final class TextHeaderAtom extends RecordAtom implements ParentAwareRecor | |||
public void setIndex(int index) { this.index = index; } | |||
@Override | |||
public RecordContainer getParentRecord() { return parentRecord; } | |||
public org.apache.poi.hslf.record.RecordContainer getParentRecord() { return parentRecord; } | |||
@Override | |||
public void setParentRecord(RecordContainer record) { this.parentRecord = record; } | |||
@@ -68,7 +68,7 @@ public final class UnknownRecordPlaceholder extends RecordAtom | |||
/** | |||
* Return the value as enum we were given at creation | |||
*/ | |||
public RecordTypes getRecordTypeEnum() { | |||
public org.apache.poi.hslf.record.RecordTypes getRecordTypeEnum() { | |||
return RecordTypes.forTypeID((int)_type); | |||
} | |||
@@ -59,7 +59,7 @@ public final class VBAInfoContainer extends RecordContainer { | |||
*/ | |||
private VBAInfoContainer() { | |||
_header = new byte[8]; | |||
_children = new Record[0]; | |||
_children = new org.apache.poi.hslf.record.Record[0]; | |||
// Setup our header block | |||
_header[0] = 0x0f; // We are a container record |
@@ -340,7 +340,7 @@ public final class HSLFHyperlink implements Hyperlink<HSLFShape,HSLFTextParagrap | |||
//document-level container which stores info about all links in a presentation | |||
ExObjList exobj = ppt.getDocumentRecord().getExObjList(false); | |||
if (exobj != null) { | |||
Record[] records = firstPara.getRecords(); | |||
org.apache.poi.hslf.record.Record[] records = firstPara.getRecords(); | |||
find(Arrays.asList(records), exobj, lst); | |||
} | |||
@@ -372,7 +372,7 @@ public final class HSLFHyperlink implements Hyperlink<HSLFShape,HSLFTextParagrap | |||
private static void find(List<? extends Record> records, ExObjList exobj, List<HSLFHyperlink> out){ | |||
ListIterator<? extends Record> iter = records.listIterator(); | |||
while (iter.hasNext()) { | |||
Record r = iter.next(); | |||
org.apache.poi.hslf.record.Record r = iter.next(); | |||
// see if we have InteractiveInfo in the textrun's records | |||
if (!(r instanceof InteractiveInfo)) { | |||
continue; |
@@ -104,7 +104,7 @@ public final class HSLFObjectShape extends HSLFPictureShape implements ObjectSha | |||
HSLFEscherClientDataRecord cldata = getClientData(true); | |||
ExObjRefAtom uer = null; | |||
for (Record r : cldata.getHSLFChildRecords()) { | |||
for (org.apache.poi.hslf.record.Record r : cldata.getHSLFChildRecords()) { | |||
if (r.getRecordType() == RecordTypes.ExObjRefAtom.typeID) { | |||
uer = (ExObjRefAtom)r; | |||
break; |
@@ -715,7 +715,7 @@ public abstract class HSLFShape implements Shape<HSLFShape,HSLFTextParagraph> { | |||
public <T extends Record> T getClientDataRecord(int recordType) { | |||
List<? extends Record> records = getClientRecords(); | |||
if (records != null) for (Record r : records) { | |||
if (records != null) for (org.apache.poi.hslf.record.Record r : records) { | |||
if (r.getRecordType() == recordType){ | |||
return (T)r; | |||
} |
@@ -162,7 +162,7 @@ public final class HSLFShapeFactory { | |||
@SuppressWarnings("unchecked") | |||
protected static <T extends Record> T getClientDataRecord(EscherContainerRecord spContainer, int recordType) { | |||
HSLFEscherClientDataRecord cldata = spContainer.getChildById(EscherClientDataRecord.RECORD_ID); | |||
if (cldata != null) for (Record r : cldata.getHSLFChildRecords()) { | |||
if (cldata != null) for (org.apache.poi.hslf.record.Record r : cldata.getHSLFChildRecords()) { | |||
if (r.getRecordType() == recordType) { | |||
return (T)r; | |||
} |
@@ -212,7 +212,7 @@ public class HSLFShapePlaceholderDetails extends HSLFPlaceholderDetails { | |||
throw new HSLFException("Placeholder aren't allowed for shape type: " + shape.getClass().getSimpleName()); | |||
} | |||
for (Record r : clientData.getHSLFChildRecords()) { | |||
for (org.apache.poi.hslf.record.Record r : clientData.getHSLFChildRecords()) { | |||
if (r instanceof OEPlaceholderAtom) { | |||
oePlaceholderAtom = (OEPlaceholderAtom)r; | |||
} else if (r instanceof RoundTripHFPlaceholder12) { |
@@ -412,7 +412,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe | |||
RecordTypes.ProgTags, RecordTypes.ProgBinaryTag, RecordTypes.BinaryTagData); | |||
if (binaryTags != null) { | |||
for (final Record record : binaryTags.getChildRecords()) { | |||
for (final org.apache.poi.hslf.record.Record record : binaryTags.getChildRecords()) { | |||
if (record instanceof Comment2000) { | |||
comments.add(new HSLFComment((Comment2000)record)); | |||
} |
@@ -85,7 +85,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
// Pointers to the most recent versions of the core records | |||
// (Document, Notes, Slide etc) | |||
private Record[] _mostRecentCoreRecords; | |||
private org.apache.poi.hslf.record.Record[] _mostRecentCoreRecords; | |||
// Lookup between the PersitPtr "sheet" IDs, and the position | |||
// in the mostRecentCoreRecords array | |||
private Map<Integer,Integer> _sheetIdToCoreRecordsLookup; | |||
@@ -117,7 +117,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
_hslfSlideShow = hslfSlideShow; | |||
// Handle Parent-aware Records | |||
for (Record record : _hslfSlideShow.getRecords()) { | |||
for (org.apache.poi.hslf.record.Record record : _hslfSlideShow.getRecords()) { | |||
if(record instanceof RecordContainer){ | |||
RecordContainer.handleParentAwareRecords((RecordContainer)record); | |||
} | |||
@@ -179,7 +179,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
private void findMostRecentCoreRecords() { | |||
// To start with, find the most recent in the byte offset domain | |||
Map<Integer,Integer> mostRecentByBytes = new HashMap<>(); | |||
for (Record record : _hslfSlideShow.getRecords()) { | |||
for (org.apache.poi.hslf.record.Record record : _hslfSlideShow.getRecords()) { | |||
if (record instanceof PersistPtrHolder) { | |||
PersistPtrHolder pph = (PersistPtrHolder) record; | |||
@@ -200,7 +200,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
// We now know how many unique special records we have, so init | |||
// the array | |||
_mostRecentCoreRecords = new Record[mostRecentByBytes.size()]; | |||
_mostRecentCoreRecords = new org.apache.poi.hslf.record.Record[mostRecentByBytes.size()]; | |||
// We'll also want to be able to turn the slide IDs into a position | |||
// in this array | |||
@@ -217,7 +217,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
} | |||
// Now convert the byte offsets back into record offsets | |||
for (Record record : _hslfSlideShow.getRecords()) { | |||
for (org.apache.poi.hslf.record.Record record : _hslfSlideShow.getRecords()) { | |||
if (!(record instanceof PositionDependentRecord)) { | |||
continue; | |||
} | |||
@@ -245,7 +245,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
} | |||
// Now look for the interesting records in there | |||
for (Record record : _mostRecentCoreRecords) { | |||
for (org.apache.poi.hslf.record.Record record : _mostRecentCoreRecords) { | |||
// Check there really is a record at this number | |||
if (record != null) { | |||
// Find the Document, and interesting things in it | |||
@@ -264,7 +264,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
* For a given SlideAtomsSet, return the core record, based on the refID | |||
* from the SlidePersistAtom | |||
*/ | |||
private Record getCoreRecordForSAS(SlideAtomsSet sas) { | |||
public org.apache.poi.hslf.record.Record getCoreRecordForSAS(SlideAtomsSet sas) { | |||
SlidePersistAtom spa = sas.getSlidePersistAtom(); | |||
int refID = spa.getRefID(); | |||
return getCoreRecordForRefID(refID); | |||
@@ -277,7 +277,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
* @param refID | |||
* the refID | |||
*/ | |||
private Record getCoreRecordForRefID(int refID) { | |||
public org.apache.poi.hslf.record.Record getCoreRecordForRefID(int refID) { | |||
Integer coreRecordId = _sheetIdToCoreRecordsLookup.get(refID); | |||
if (coreRecordId != null) { | |||
return _mostRecentCoreRecords[coreRecordId]; | |||
@@ -342,7 +342,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
} | |||
for (SlideAtomsSet sas : masterSLWT.getSlideAtomsSets()) { | |||
Record r = getCoreRecordForSAS(sas); | |||
org.apache.poi.hslf.record.Record r = getCoreRecordForSAS(sas); | |||
int sheetNo = sas.getSlidePersistAtom().getSlideIdentifier(); | |||
if (r instanceof Slide) { | |||
HSLFTitleMaster master = new HSLFTitleMaster((Slide)r, sheetNo); | |||
@@ -368,7 +368,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
for (SlideAtomsSet notesSet : notesSLWT.getSlideAtomsSets()) { | |||
idx++; | |||
// Get the right core record | |||
Record r = getCoreRecordForSAS(notesSet); | |||
org.apache.poi.hslf.record.Record r = getCoreRecordForSAS(notesSet); | |||
SlidePersistAtom spa = notesSet.getSlidePersistAtom(); | |||
String loggerLoc = "A Notes SlideAtomSet at "+idx+" said its record was at refID "+spa.getRefID(); | |||
@@ -409,7 +409,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
idx++; | |||
// Get the right core record | |||
SlidePersistAtom spa = sas.getSlidePersistAtom(); | |||
Record r = getCoreRecordForSAS(sas); | |||
org.apache.poi.hslf.record.Record r = getCoreRecordForSAS(sas); | |||
// Ensure it really is a slide record | |||
if (!(r instanceof Slide)) { | |||
@@ -492,7 +492,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
* Returns an array of the most recent version of all the interesting | |||
* records | |||
*/ | |||
public Record[] getMostRecentCoreRecords() { | |||
public org.apache.poi.hslf.record.Record[] getMostRecentCoreRecords() { | |||
return _mostRecentCoreRecords; | |||
} | |||
@@ -611,13 +611,13 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
_slides.get(newSlideNumber - 1).setSlideNumber(newSlideNumber); | |||
_slides.get(oldSlideNumber - 1).setSlideNumber(oldSlideNumber); | |||
ArrayList<Record> lst = new ArrayList<>(); | |||
ArrayList<org.apache.poi.hslf.record.Record> lst = new ArrayList<>(); | |||
for (SlideAtomsSet s : sas) { | |||
lst.add(s.getSlidePersistAtom()); | |||
lst.addAll(Arrays.asList(s.getSlideRecords())); | |||
} | |||
Record[] r = lst.toArray(new Record[0]); | |||
org.apache.poi.hslf.record.Record[] r = lst.toArray(new org.apache.poi.hslf.record.Record[0]); | |||
slwt.setChildRecord(r); | |||
} | |||
@@ -646,7 +646,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
} | |||
SlideAtomsSet[] sas = slwt.getSlideAtomsSets(); | |||
List<Record> records = new ArrayList<>(); | |||
List<org.apache.poi.hslf.record.Record> records = new ArrayList<>(); | |||
List<SlideAtomsSet> sa = new ArrayList<>(Arrays.asList(sas)); | |||
HSLFSlide removedSlide = _slides.remove(index); | |||
@@ -666,7 +666,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
_documentRecord.removeSlideListWithText(slwt); | |||
} else { | |||
slwt.setSlideAtomsSets(sa.toArray(new SlideAtomsSet[0])); | |||
slwt.setChildRecord(records.toArray(new Record[0])); | |||
slwt.setChildRecord(records.toArray(new org.apache.poi.hslf.record.Record[0])); | |||
} | |||
// if the removed slide had notes - remove references to them too | |||
@@ -690,7 +690,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
if (!na.isEmpty()) { | |||
nslwt.setSlideAtomsSets(na.toArray(new SlideAtomsSet[0])); | |||
nslwt.setChildRecord(records.toArray(new Record[0])); | |||
nslwt.setChildRecord(records.toArray(new org.apache.poi.hslf.record.Record[0])); | |||
} | |||
} | |||
if (na.isEmpty()) { | |||
@@ -1042,7 +1042,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
ExEmbed exEmbed = new ExEmbed(); | |||
// remove unneccessary infos, so we don't need to specify the type | |||
// of the ole object multiple times | |||
Record[] children = exEmbed.getChildRecords(); | |||
org.apache.poi.hslf.record.Record[] children = exEmbed.getChildRecords(); | |||
exEmbed.removeChild(children[2]); | |||
exEmbed.removeChild(children[3]); | |||
exEmbed.removeChild(children[4]); | |||
@@ -1108,7 +1108,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap | |||
private int addPersistentObject(PositionDependentRecord slideRecord) { | |||
slideRecord.setLastOnDiskOffset(HSLFSlideShowImpl.UNSET_OFFSET); | |||
_hslfSlideShow.appendRootLevelRecord((Record)slideRecord); | |||
_hslfSlideShow.appendRootLevelRecord((org.apache.poi.hslf.record.Record)slideRecord); | |||
// For position dependent records, hold where they were and now are | |||
// As we go along, update, and hand over, to any Position Dependent |
@@ -83,7 +83,7 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
// need to ignore already set UserEdit and PersistAtoms | |||
UserEditAtom userEditAtomWithEncryption = null; | |||
for (Map.Entry<Integer, Record> me : recordMap.descendingMap().entrySet()) { | |||
Record r = me.getValue(); | |||
org.apache.poi.hslf.record.Record r = me.getValue(); | |||
if (!(r instanceof UserEditAtom)) { | |||
continue; | |||
} | |||
@@ -99,7 +99,7 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
return; | |||
} | |||
Record r = recordMap.get(userEditAtomWithEncryption.getPersistPointersOffset()); | |||
org.apache.poi.hslf.record.Record r = recordMap.get(userEditAtomWithEncryption.getPersistPointersOffset()); | |||
assert(r instanceof PersistPtrHolder); | |||
PersistPtrHolder ptr = (PersistPtrHolder)r; | |||
@@ -138,7 +138,7 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
return (dea != null) ? dea.getEncryptionInfo() : null; | |||
} | |||
protected OutputStream encryptRecord(OutputStream plainStream, int persistId, Record record) { | |||
protected OutputStream encryptRecord(OutputStream plainStream, int persistId, org.apache.poi.hslf.record.Record record) { | |||
boolean isPlain = (dea == null | |||
|| record instanceof UserEditAtom | |||
|| record instanceof PersistPtrHolder | |||
@@ -359,7 +359,7 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
} | |||
} | |||
protected Record[] updateEncryptionRecord(Record[] records) { | |||
protected org.apache.poi.hslf.record.Record[] updateEncryptionRecord(org.apache.poi.hslf.record.Record[] records) { | |||
String password = Biff8EncryptionKey.getCurrentUserPassword(); | |||
if (password == null) { | |||
if (dea == null) { | |||
@@ -396,7 +396,7 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
* Before this method is called, make sure that the offsets are correct, | |||
* i.e. call {@link HSLFSlideShowImpl#updateAndWriteDependantRecords(OutputStream, Map)} | |||
*/ | |||
protected static Record[] normalizeRecords(Record[] records) { | |||
protected static org.apache.poi.hslf.record.Record[] normalizeRecords(org.apache.poi.hslf.record.Record[] records) { | |||
// http://msdn.microsoft.com/en-us/library/office/gg615594(v=office.14).aspx | |||
// repeated slideIds can be overwritten, i.e. ignored | |||
@@ -406,7 +406,7 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
TreeMap<Integer,Record> recordMap = new TreeMap<>(); | |||
List<Integer> obsoleteOffsets = new ArrayList<>(); | |||
int duplicatedCount = 0; | |||
for (Record r : records) { | |||
for (org.apache.poi.hslf.record.Record r : records) { | |||
assert(r instanceof PositionDependentRecord); | |||
PositionDependentRecord pdr = (PositionDependentRecord)r; | |||
if (pdr instanceof UserEditAtom) { | |||
@@ -452,17 +452,17 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
recordMap.remove(oldOffset); | |||
} | |||
return recordMap.values().toArray(new Record[0]); | |||
return recordMap.values().toArray(new org.apache.poi.hslf.record.Record[0]); | |||
} | |||
protected static Record[] removeEncryptionRecord(Record[] records) { | |||
protected static org.apache.poi.hslf.record.Record[] removeEncryptionRecord(org.apache.poi.hslf.record.Record[] records) { | |||
int deaSlideId = -1; | |||
int deaOffset = -1; | |||
PersistPtrHolder ptr = null; | |||
UserEditAtom uea = null; | |||
List<Record> recordList = new ArrayList<>(); | |||
for (Record r : records) { | |||
List<org.apache.poi.hslf.record.Record> recordList = new ArrayList<>(); | |||
for (org.apache.poi.hslf.record.Record r : records) { | |||
if (r instanceof DocumentEncryptionAtom) { | |||
deaOffset = ((DocumentEncryptionAtom)r).getLastOnDiskOffset(); | |||
continue; | |||
@@ -496,16 +496,16 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
uea.setMaxPersistWritten(maxSlideId); | |||
records = recordList.toArray(new Record[0]); | |||
records = recordList.toArray(new org.apache.poi.hslf.record.Record[0]); | |||
return records; | |||
} | |||
protected static Record[] addEncryptionRecord(Record[] records, DocumentEncryptionAtom dea) { | |||
protected static org.apache.poi.hslf.record.Record[] addEncryptionRecord(org.apache.poi.hslf.record.Record[] records, DocumentEncryptionAtom dea) { | |||
assert(dea != null); | |||
int ueaIdx = -1, ptrIdx = -1, deaIdx = -1, idx = -1; | |||
for (Record r : records) { | |||
for (org.apache.poi.hslf.record.Record r : records) { | |||
idx++; | |||
if (r instanceof UserEditAtom) { | |||
ueaIdx = idx; | |||
@@ -530,7 +530,7 @@ public class HSLFSlideShowEncrypted implements Closeable { | |||
uea.setEncryptSessionPersistIdRef(nextSlideId); | |||
uea.setMaxPersistWritten(nextSlideId); | |||
Record[] newRecords = new Record[records.length + 1]; | |||
org.apache.poi.hslf.record.Record[] newRecords = new org.apache.poi.hslf.record.Record[records.length + 1]; | |||
if (ptrIdx > 0) { | |||
System.arraycopy(records, 0, newRecords, 0, ptrIdx); | |||
} |
@@ -82,7 +82,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
private byte[] _docstream; | |||
// Low level contents | |||
private Record[] _records; | |||
private org.apache.poi.hslf.record.Record[] _records; | |||
// Raw Pictures contained in the pictures stream | |||
private List<HSLFPictureData> _pictures; | |||
@@ -251,7 +251,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
_records = read(_docstream, (int) currentUser.getCurrentEditOffset()); | |||
} | |||
private Record[] read(byte[] docstream, int usrOffset) throws IOException { | |||
private org.apache.poi.hslf.record.Record[] read(byte[] docstream, int usrOffset) throws IOException { | |||
//sort found records by offset. | |||
//(it is not necessary but SlideShow.findMostRecentCoreRecords() expects them sorted) | |||
NavigableMap<Integer, Record> records = new TreeMap<>(); // offset -> record | |||
@@ -261,7 +261,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
for (Map.Entry<Integer, Record> entry : records.entrySet()) { | |||
Integer offset = entry.getKey(); | |||
Record record = entry.getValue(); | |||
org.apache.poi.hslf.record.Record record = entry.getValue(); | |||
Integer persistId = persistIds.get(offset); | |||
if (record == null) { | |||
// all plain records have been already added, | |||
@@ -277,7 +277,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
} | |||
decryptData.close(); | |||
return records.values().toArray(new Record[0]); | |||
return records.values().toArray(new org.apache.poi.hslf.record.Record[0]); | |||
} | |||
private void initRecordOffsets(byte[] docstream, int usrOffset, NavigableMap<Integer, Record> recordMap, Map<Integer, Integer> offset2id) { | |||
@@ -318,7 +318,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
} | |||
public DocumentEncryptionAtom getDocumentEncryptionAtom() { | |||
for (Record r : _records) { | |||
for (org.apache.poi.hslf.record.Record r : _records) { | |||
if (r instanceof DocumentEncryptionAtom) { | |||
return (DocumentEncryptionAtom) r; | |||
} | |||
@@ -470,7 +470,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
UserEditAtom usr = null; | |||
PersistPtrHolder ptr = null; | |||
CountingOS cos = new CountingOS(); | |||
for (Record record : _records) { | |||
for (org.apache.poi.hslf.record.Record record : _records) { | |||
// all top level records are position dependent | |||
assert (record instanceof PositionDependentRecord); | |||
PositionDependentRecord pdr = (PositionDependentRecord) record; | |||
@@ -512,7 +512,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
} | |||
try (HSLFSlideShowEncrypted encData = new HSLFSlideShowEncrypted(getDocumentEncryptionAtom())) { | |||
for (Record record : _records) { | |||
for (org.apache.poi.hslf.record.Record record : _records) { | |||
assert (record instanceof PositionDependentRecord); | |||
// We've already figured out their new location, and | |||
// told them that | |||
@@ -727,7 +727,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) | |||
public synchronized int appendRootLevelRecord(Record newRecord) { | |||
int addedAt = -1; | |||
Record[] r = new Record[_records.length + 1]; | |||
org.apache.poi.hslf.record.Record[] r = new org.apache.poi.hslf.record.Record[_records.length + 1]; | |||
boolean added = false; | |||
for (int i = (_records.length - 1); i >= 0; i--) { | |||
if (added) { | |||
@@ -779,7 +779,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
/** | |||
* Returns an array of all the records found in the slideshow | |||
*/ | |||
public Record[] getRecords() { | |||
public org.apache.poi.hslf.record.Record[] getRecords() { | |||
return _records; | |||
} | |||
@@ -824,7 +824,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { | |||
public HSLFObjectData[] getEmbeddedObjects() { | |||
if (_objects == null) { | |||
List<HSLFObjectData> objects = new ArrayList<>(); | |||
for (Record r : _records) { | |||
for (org.apache.poi.hslf.record.Record r : _records) { | |||
if (r instanceof ExOleObjStg) { | |||
objects.add(new HSLFObjectData((ExOleObjStg) r)); | |||
} |
@@ -76,11 +76,11 @@ public final class HSLFSoundData { | |||
*/ | |||
public static HSLFSoundData[] find(Document document){ | |||
ArrayList<HSLFSoundData> lst = new ArrayList<>(); | |||
Record[] ch = document.getChildRecords(); | |||
org.apache.poi.hslf.record.Record[] ch = document.getChildRecords(); | |||
for (int i = 0; i < ch.length; i++) { | |||
if(ch[i].getRecordType() == RecordTypes.SoundCollection.typeID){ | |||
RecordContainer col = (RecordContainer)ch[i]; | |||
Record[] sr = col.getChildRecords(); | |||
org.apache.poi.hslf.record.Record[] sr = col.getChildRecords(); | |||
for (int j = 0; j < sr.length; j++) { | |||
if(sr[j] instanceof Sound){ | |||
lst.add(new HSLFSoundData((Sound)sr[j])); |
@@ -267,7 +267,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
_ruler = getTextRuler(); | |||
if (_ruler == null) { | |||
_ruler = TextRulerAtom.getParagraphInstance(); | |||
Record childAfter = _byteAtom; | |||
org.apache.poi.hslf.record.Record childAfter = _byteAtom; | |||
if (childAfter == null) { | |||
childAfter = _charAtom; | |||
} | |||
@@ -285,18 +285,18 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
* | |||
* @return text run records | |||
*/ | |||
public Record[] getRecords() { | |||
Record[] r = _headerAtom.getParentRecord().getChildRecords(); | |||
public org.apache.poi.hslf.record.Record[] getRecords() { | |||
org.apache.poi.hslf.record.Record[] r = _headerAtom.getParentRecord().getChildRecords(); | |||
return getRecords(r, new int[] { 0 }, _headerAtom); | |||
} | |||
private static Record[] getRecords(Record[] records, int[] startIdx, TextHeaderAtom headerAtom) { | |||
private static org.apache.poi.hslf.record.Record[] getRecords(org.apache.poi.hslf.record.Record[] records, int[] startIdx, TextHeaderAtom headerAtom) { | |||
if (records == null) { | |||
throw new NullPointerException("records need to be set."); | |||
} | |||
for (; startIdx[0] < records.length; startIdx[0]++) { | |||
Record r = records[startIdx[0]]; | |||
org.apache.poi.hslf.record.Record r = records[startIdx[0]]; | |||
if (r instanceof TextHeaderAtom && (headerAtom == null || r == headerAtom)) { | |||
break; | |||
} | |||
@@ -304,18 +304,18 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
if (startIdx[0] >= records.length) { | |||
logger.log(POILogger.INFO, "header atom wasn't found - container might contain only an OutlineTextRefAtom"); | |||
return new Record[0]; | |||
return new org.apache.poi.hslf.record.Record[0]; | |||
} | |||
int length; | |||
for (length = 1; startIdx[0] + length < records.length; length++) { | |||
Record r = records[startIdx[0]+length]; | |||
org.apache.poi.hslf.record.Record r = records[startIdx[0]+length]; | |||
if (r instanceof TextHeaderAtom || r instanceof SlidePersistAtom) { | |||
break; | |||
} | |||
} | |||
Record[] result = new Record[length]; | |||
org.apache.poi.hslf.record.Record[] result = new org.apache.poi.hslf.record.Record[length]; | |||
System.arraycopy(records, startIdx[0], result, 0, length); | |||
startIdx[0] += length; | |||
@@ -932,7 +932,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
private static StyleTextPropAtom findStyleAtomPresent(TextHeaderAtom header, int textLen) { | |||
boolean afterHeader = false; | |||
StyleTextPropAtom style = null; | |||
for (Record record : header.getParentRecord().getChildRecords()) { | |||
for (org.apache.poi.hslf.record.Record record : header.getParentRecord().getChildRecords()) { | |||
long rt = record.getRecordType(); | |||
if (afterHeader && rt == RecordTypes.TextHeaderAtom.typeID) { | |||
// already on the next header, quit searching | |||
@@ -989,7 +989,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
StyleTextPropAtom styleAtom = findStyleAtomPresent(headerAtom, rawText.length()); | |||
// Store in the appropriate record | |||
Record oldRecord = null, newRecord; | |||
org.apache.poi.hslf.record.Record oldRecord = null, newRecord; | |||
if (isUnicode) { | |||
if (byteAtom != null || charAtom == null) { | |||
oldRecord = byteAtom; | |||
@@ -1010,10 +1010,10 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
assert (newRecord != null); | |||
RecordContainer _txtbox = headerAtom.getParentRecord(); | |||
Record[] cr = _txtbox.getChildRecords(); | |||
org.apache.poi.hslf.record.Record[] cr = _txtbox.getChildRecords(); | |||
int /* headerIdx = -1, */ textIdx = -1, styleIdx = -1; | |||
for (int i = 0; i < cr.length; i++) { | |||
Record r = cr[i]; | |||
org.apache.poi.hslf.record.Record r = cr[i]; | |||
if (r == headerAtom) { | |||
// headerIdx = i; | |||
} else if (r == oldRecord || r == newRecord) { | |||
@@ -1099,7 +1099,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
// If TextSpecInfoAtom is present, we must update the text size in it, | |||
// otherwise the ppt will be corrupted | |||
for (Record r : paragraphs.get(0).getRecords()) { | |||
for (org.apache.poi.hslf.record.Record r : paragraphs.get(0).getRecords()) { | |||
if (r instanceof TextSpecInfoAtom) { | |||
((TextSpecInfoAtom) r).setParentSize(rawText.length() + 1); | |||
break; | |||
@@ -1111,7 +1111,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
TextHeaderAtom headerAtom = paragraphs.get(0)._headerAtom; | |||
RecordContainer _txtbox = headerAtom.getParentRecord(); | |||
// remove existing hyperlink records | |||
for (Record r : _txtbox.getChildRecords()) { | |||
for (org.apache.poi.hslf.record.Record r : _txtbox.getChildRecords()) { | |||
if (r instanceof InteractiveInfo || r instanceof TxInteractiveInfoAtom) { | |||
_txtbox.removeChild(r); | |||
} | |||
@@ -1403,7 +1403,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
* | |||
* @param records the records to build from | |||
*/ | |||
protected static List<List<HSLFTextParagraph>> findTextParagraphs(Record[] records) { | |||
protected static List<List<HSLFTextParagraph>> findTextParagraphs(org.apache.poi.hslf.record.Record[] records) { | |||
List<List<HSLFTextParagraph>> paragraphCollection = new ArrayList<>(); | |||
int[] recordIdx = { 0 }; | |||
@@ -1415,7 +1415,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText | |||
TextRulerAtom ruler = null; | |||
MasterTextPropAtom indents = null; | |||
for (Record r : getRecords(records, recordIdx, null)) { | |||
for (org.apache.poi.hslf.record.Record r : getRecords(records, recordIdx, null)) { | |||
long rt = r.getRecordType(); | |||
if (RecordTypes.TextHeaderAtom.typeID == rt) { | |||
header = (TextHeaderAtom) r; |
@@ -47,7 +47,7 @@ public final class TestRecordContainer { | |||
is.close(); | |||
Record[] r = hss.getRecords(); | |||
for (Record rec : r) { | |||
for ( org.apache.poi.hslf.record.Record rec : r) { | |||
if(rec instanceof RecordContainer) { | |||
recordContainer = (RecordContainer)rec; | |||
return; |
@@ -42,7 +42,7 @@ public final class TestSound { | |||
Document doc = ppt.getDocumentRecord(); | |||
SoundCollection soundCollection = null; | |||
Record[] doc_ch = doc.getChildRecords(); | |||
for (Record rec : doc_ch) { | |||
for ( org.apache.poi.hslf.record.Record rec : doc_ch) { | |||
if (rec instanceof SoundCollection) { | |||
soundCollection = (SoundCollection) rec; | |||
break; | |||
@@ -53,7 +53,7 @@ public final class TestSound { | |||
Sound sound = null; | |||
Record[] sound_ch = soundCollection.getChildRecords(); | |||
int k = 0; | |||
for (Record rec : sound_ch) { | |||
for ( org.apache.poi.hslf.record.Record rec : sound_ch) { | |||
if (rec instanceof Sound) { | |||
sound = (Sound) rec; | |||
k++; |
@@ -81,7 +81,7 @@ public final class TestAddingSlides { | |||
// grab UserEditAtom | |||
UserEditAtom usredit = null; | |||
Record[] _records = ss_empty.getSlideShowImpl().getRecords(); | |||
for (Record record : _records) { | |||
for ( org.apache.poi.hslf.record.Record record : _records) { | |||
if (record.getRecordType() == RecordTypes.UserEditAtom.typeID) { | |||
usredit = (UserEditAtom) record; | |||
} | |||
@@ -169,7 +169,7 @@ public final class TestAddingSlides { | |||
// grab UserEditAtom | |||
UserEditAtom usredit = null; | |||
Record[] _records = ss_two.getSlideShowImpl().getRecords(); | |||
for (Record record : _records) { | |||
for ( org.apache.poi.hslf.record.Record record : _records) { | |||
if (record.getRecordType() == RecordTypes.UserEditAtom.typeID) { | |||
usredit = (UserEditAtom) record; | |||
} |
@@ -517,7 +517,7 @@ public final class TestBugs { | |||
SlideAtomsSet s1 = slidesSLWT.getSlideAtomsSets()[0]; | |||
int tha = 0; | |||
for (Record r : s1.getSlideRecords()) { | |||
for ( org.apache.poi.hslf.record.Record r : s1.getSlideRecords()) { | |||
if (r instanceof TextHeaderAtom) { | |||
tha++; | |||
} |
@@ -44,7 +44,7 @@ public final class TestMostRecentRecords { | |||
@Test | |||
public void testCount() { | |||
// Most recent core records | |||
Record[] mrcr = ss.getMostRecentCoreRecords(); | |||
org.apache.poi.hslf.record.Record[] mrcr = ss.getMostRecentCoreRecords(); | |||
// Master sheet + master notes + 2 slides + 2 notes + document | |||
assertEquals(7, mrcr.length); | |||
@@ -53,7 +53,7 @@ public final class TestMostRecentRecords { | |||
@Test | |||
public void testRightRecordTypes() { | |||
// Most recent core records | |||
Record[] mrcr = ss.getMostRecentCoreRecords(); | |||
org.apache.poi.hslf.record.Record[] mrcr = ss.getMostRecentCoreRecords(); | |||
// Document | |||
assertEquals(1000, mrcr[0].getRecordType()); | |||
@@ -75,10 +75,10 @@ public final class TestMostRecentRecords { | |||
@Test | |||
public void testCorrectRecords() { | |||
// Most recent core records | |||
Record[] mrcr = ss.getMostRecentCoreRecords(); | |||
org.apache.poi.hslf.record.Record[] mrcr = ss.getMostRecentCoreRecords(); | |||
// All records | |||
Record[] allr = hss.getRecords(); | |||
org.apache.poi.hslf.record.Record[] allr = hss.getRecords(); | |||
// Ensure they are the right (latest) version of each | |||
@@ -46,20 +46,20 @@ public final class TestRecordSetup { | |||
@Test | |||
public void testHandleParentAwareRecords() { | |||
Record[] records = hss.getRecords(); | |||
for (Record record : records) { | |||
org.apache.poi.hslf.record.Record[] records = hss.getRecords(); | |||
for ( org.apache.poi.hslf.record.Record record : records) { | |||
ensureParentAware(record,null); | |||
} | |||
} | |||
private void ensureParentAware(Record r,RecordContainer parent) { | |||
private void ensureParentAware( org.apache.poi.hslf.record.Record r,RecordContainer parent) { | |||
if(r instanceof ParentAwareRecord) { | |||
ParentAwareRecord pr = (ParentAwareRecord)r; | |||
assertEquals(parent, pr.getParentRecord()); | |||
} | |||
if(r instanceof RecordContainer) { | |||
RecordContainer rc = (RecordContainer)r; | |||
Record[] children = rc.getChildRecords(); | |||
for (Record rec : children) { | |||
org.apache.poi.hslf.record.Record[] children = rc.getChildRecords(); | |||
for ( org.apache.poi.hslf.record.Record rec : children) { | |||
ensureParentAware(rec, rc); | |||
} | |||
} |
@@ -418,7 +418,7 @@ public final class TestRichTextRun { | |||
assertArrayEquals(raw_file, raw_ss); | |||
} | |||
private byte[] writeRecord(Record r) throws IOException { | |||
private byte[] writeRecord( org.apache.poi.hslf.record.Record r) throws IOException { | |||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
r.writeOut(baos); | |||
return baos.toByteArray(); |
@@ -129,7 +129,7 @@ public final class TestTextRun { | |||
TextHeaderAtom tha = null; | |||
TextBytesAtom tba = null; | |||
TextCharsAtom tca = null; | |||
for (Record r : para.getRecords()) { | |||
for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { | |||
if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; | |||
else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; | |||
else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; | |||
@@ -145,7 +145,7 @@ public final class TestTextRun { | |||
HSLFTextParagraph.setText(paras, changeBytesOnly); | |||
para = paras.get(0); | |||
tha = null; tba = null; tca = null; | |||
for (Record r : para.getRecords()) { | |||
for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { | |||
if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; | |||
else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; | |||
else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; | |||
@@ -164,7 +164,7 @@ public final class TestTextRun { | |||
HSLFTextParagraph.setText(paras, changeByteChar); | |||
para = paras.get(0); | |||
tha = null; tba = null; tca = null; | |||
for (Record r : para.getRecords()) { | |||
for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { | |||
if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; | |||
else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; | |||
else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; | |||
@@ -183,7 +183,7 @@ public final class TestTextRun { | |||
HSLFTextParagraph.setText(paras, changeCharChar); | |||
para = paras.get(0); | |||
tha = null; tba = null; tca = null; | |||
for (Record r : para.getRecords()) { | |||
for ( org.apache.poi.hslf.record.Record r : para.getRecords()) { | |||
if (r instanceof TextHeaderAtom) tha = (TextHeaderAtom)r; | |||
else if (r instanceof TextBytesAtom) tba = (TextBytesAtom)r; | |||
else if (r instanceof TextCharsAtom) tca = (TextCharsAtom)r; | |||
@@ -525,8 +525,8 @@ public final class TestTextRun { | |||
HSLFTextShape tx = (HSLFTextShape)sh; | |||
List<HSLFTextParagraph> paras = tx.getTextParagraphs(); | |||
//verify that records cached in TextRun and EscherTextboxWrapper are the same | |||
Record[] runChildren = paras.get(0).getRecords(); | |||
Record[] txboxChildren = tx.getEscherTextboxWrapper().getChildRecords(); | |||
org.apache.poi.hslf.record.Record[] runChildren = paras.get(0).getRecords(); | |||
org.apache.poi.hslf.record.Record[] txboxChildren = tx.getEscherTextboxWrapper().getChildRecords(); | |||
assertEquals(runChildren.length, txboxChildren.length); | |||
for(int i=0; i < txboxChildren.length; i++){ | |||
assertSame(txboxChildren[i], runChildren[i]); |
@@ -95,7 +95,7 @@ public final class TestAbortableListener { | |||
lastRecordSeen = null; | |||
} | |||
@Override | |||
public short abortableProcessRecord(Record record) { | |||
public short abortableProcessRecord(org.apache.poi.hssf.record.Record record) { | |||
countSeen++; | |||
lastRecordSeen = record; | |||
@@ -61,7 +61,7 @@ public final class TestEventWorkbookBuilder { | |||
} | |||
} | |||
private void addFormulaRecord(Record r) { | |||
private void addFormulaRecord(org.apache.poi.hssf.record.Record r) { | |||
if (r instanceof FormulaRecord) { | |||
fRecs.add((FormulaRecord)r); | |||
} |
@@ -82,7 +82,7 @@ public final class TestFormatTrackingHSSFListener { | |||
// Now check we can turn all the numeric | |||
// cells into strings without error | |||
for(Record r : mockListen._records) { | |||
for(org.apache.poi.hssf.record.Record r : mockListen._records) { | |||
CellValueRecordInterface cvr = null; | |||
if(r instanceof NumberRecord) { | |||
@@ -106,10 +106,10 @@ public final class TestFormatTrackingHSSFListener { | |||
private static final class MockHSSFListener implements HSSFListener { | |||
public MockHSSFListener() {} | |||
private final List<Record> _records = new ArrayList<>(); | |||
private final List<org.apache.poi.hssf.record.Record> _records = new ArrayList<>(); | |||
@Override | |||
public void processRecord(Record record) { | |||
public void processRecord(org.apache.poi.hssf.record.Record record) { | |||
_records.add(record); | |||
} | |||
} |
@@ -47,7 +47,7 @@ import org.junit.Test; | |||
* Testing for {@link HSSFEventFactory} | |||
*/ | |||
public final class TestHSSFEventFactory { | |||
private final List<Record> records = new ArrayList<>(); | |||
private final List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
private void openSample(String sampleFileName) throws IOException { | |||
records.clear(); | |||
@@ -132,7 +132,7 @@ public final class TestHSSFEventFactory { | |||
// Has one sheet, with values 1,2,3 in column A rows 1-3 | |||
boolean hasSheet = false, hasA1 = false, hasA2 = false, hasA3 = false; | |||
for (Record r : records) { | |||
for (org.apache.poi.hssf.record.Record r : records) { | |||
if (r instanceof BoundSheetRecord) { | |||
BoundSheetRecord bsr = (BoundSheetRecord) r; | |||
assertEquals("Sheet1", bsr.getSheetname()); |
@@ -48,7 +48,7 @@ import org.junit.Test; | |||
*/ | |||
public final class TestMissingRecordAwareHSSFListener { | |||
private final List<Record> _records = new ArrayList<>(); | |||
private final List<org.apache.poi.hssf.record.Record> _records = new ArrayList<>(); | |||
private void readRecords(String sampleFileName) throws IOException { | |||
_records.clear(); | |||
@@ -103,7 +103,7 @@ public final class TestMissingRecordAwareHSSFListener { | |||
readRecords("MRExtraLines.xls"); | |||
int rowCount=0; | |||
for (Record rec : _records) { | |||
for (org.apache.poi.hssf.record.Record rec : _records) { | |||
if (rec instanceof LastCellOfRowDummyRecord) { | |||
LastCellOfRowDummyRecord eor = (LastCellOfRowDummyRecord) rec; | |||
assertEquals(rowCount, eor.getRow()); | |||
@@ -158,10 +158,10 @@ public final class TestMissingRecordAwareHSSFListener { | |||
assertEquals(exp, act); | |||
} | |||
private int lastIndexOf(Predicate<Record> pre) { | |||
private int lastIndexOf(Predicate<org.apache.poi.hssf.record.Record> pre) { | |||
int found = -1; | |||
int i = 0; | |||
for (Record r : _records) { | |||
for (org.apache.poi.hssf.record.Record r : _records) { | |||
if (pre.test(r)) { | |||
found = i; | |||
} | |||
@@ -173,7 +173,7 @@ public final class TestMissingRecordAwareHSSFListener { | |||
private String digest(int start, int len) { | |||
StringBuilder sb = new StringBuilder(len*10); | |||
int lastRow = -1; | |||
for (Record r : _records.subList(start, start+len+1)) { | |||
for (org.apache.poi.hssf.record.Record r : _records.subList(start, start+len+1)) { | |||
String dig = null; | |||
int row = -1; | |||
if (r instanceof RowRecord) { | |||
@@ -221,7 +221,7 @@ public final class TestMissingRecordAwareHSSFListener { | |||
return sb.toString(); | |||
} | |||
private long matches(Predicate<Record> r) { | |||
private long matches(Predicate<org.apache.poi.hssf.record.Record> r) { | |||
return _records.stream().filter(r).count(); | |||
} | |||
} |
@@ -113,7 +113,7 @@ public class TestDrawingAggregate { | |||
byte[] getRawBytes(){ | |||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |||
for (RecordBase rb : aggRecords) { | |||
Record r = (Record) rb; | |||
Record r = (org.apache.poi.hssf.record.Record) rb; | |||
try { | |||
out.write(r.serialize()); | |||
} catch (IOException e) { | |||
@@ -255,7 +255,7 @@ public class TestDrawingAggregate { | |||
private static byte[] toByteArray(List<RecordBase> records) { | |||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |||
for (RecordBase rb : records) { | |||
Record r = (Record) rb; | |||
Record r = (org.apache.poi.hssf.record.Record) rb; | |||
try { | |||
out.write(r.serialize()); | |||
} catch (IOException e) { | |||
@@ -370,7 +370,7 @@ public class TestDrawingAggregate { | |||
byte[] dgBytes = toByteArray(dgRecords); | |||
for (RecordBase rb : dgRecords) { | |||
Record r = (Record) rb; | |||
Record r = (org.apache.poi.hssf.record.Record) rb; | |||
short sid = r.getSid(); | |||
// we expect that drawing block consists of either | |||
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord | |||
@@ -435,7 +435,7 @@ public class TestDrawingAggregate { | |||
// records to be aggregated | |||
List<RecordBase> dgRecords = records.subList(19, 26); | |||
for (RecordBase rb : dgRecords) { | |||
Record r = (Record) rb; | |||
Record r = (org.apache.poi.hssf.record.Record) rb; | |||
short sid = r.getSid(); | |||
// we expect that drawing block consists of either | |||
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord | |||
@@ -493,8 +493,8 @@ public class TestDrawingAggregate { | |||
assertSame(r1.getClass(), r2.getClass()); | |||
assertEquals(r1.getRecordSize(), r2.getRecordSize()); | |||
if (r1 instanceof Record) { | |||
assertEquals(((Record) r1).getSid(), ((Record) r2).getSid()); | |||
assertArrayEquals(((Record) r1).serialize(), ((Record) r2).serialize()); | |||
assertEquals(((org.apache.poi.hssf.record.Record) r1).getSid(), ((org.apache.poi.hssf.record.Record) r2).getSid()); | |||
assertArrayEquals(((org.apache.poi.hssf.record.Record) r1).serialize(), ((org.apache.poi.hssf.record.Record) r2).serialize()); | |||
} | |||
} | |||
} | |||
@@ -520,7 +520,7 @@ public class TestDrawingAggregate { | |||
// records to be aggregated | |||
List<RecordBase> dgRecords = records.subList(19, 39); | |||
for (RecordBase rb : dgRecords) { | |||
Record r = (Record) rb; | |||
Record r = (org.apache.poi.hssf.record.Record) rb; | |||
short sid = r.getSid(); | |||
// we expect that drawing block consists of either | |||
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord | |||
@@ -581,7 +581,7 @@ public class TestDrawingAggregate { | |||
// records to be aggregated | |||
List<RecordBase> dgRecords = records.subList(22, 300); | |||
for (RecordBase rb : dgRecords) { | |||
Record r = (Record) rb; | |||
Record r = (org.apache.poi.hssf.record.Record) rb; | |||
short sid = r.getSid(); | |||
// we expect that drawing block consists of either | |||
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord | |||
@@ -723,7 +723,7 @@ public class TestDrawingAggregate { | |||
"fvcr1v8aFU6POn+OCqfj4ffS/e+pcOEMKhABrCdUAAPhwB+pQHYGFcT/BBUEz6LC/wGpc+eRNSkAAA=="; | |||
byte[] dgBytes = decompress(data); | |||
List<Record> dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); | |||
List<org.apache.poi.hssf.record.Record> dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); | |||
assertEquals(20, dgRecords.size()); | |||
short[] expectedSids = { | |||
@@ -901,7 +901,7 @@ public class TestDrawingAggregate { | |||
"BPza/oPKABD5z4SARKQEELP1WQsFMc+QwP8ATkmhK404AAA="; | |||
byte[] dgBytes = decompress(data); | |||
List<Record> dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); | |||
List<org.apache.poi.hssf.record.Record> dgRecords = RecordFactory.createRecords(new ByteArrayInputStream(dgBytes)); | |||
assertEquals(14, dgRecords.size()); | |||
short[] expectedSids = { |
@@ -44,7 +44,7 @@ public class TestEscherRecordFactory { | |||
private static byte[] toByteArray(List<RecordBase> records) { | |||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |||
for (RecordBase rb : records) { | |||
Record r = (Record) rb; | |||
Record r = (org.apache.poi.hssf.record.Record) rb; | |||
try { | |||
out.write(r.serialize()); | |||
} catch (IOException e) { |
@@ -127,7 +127,7 @@ public final class TestLinkTable { | |||
SupBookRecord.createAddInFunctions(), | |||
new SSTRecord(), | |||
}; | |||
List<Record> recList = Arrays.asList(recs); | |||
List<org.apache.poi.hssf.record.Record> recList = Arrays.asList(recs); | |||
WorkbookRecordList wrl = new WorkbookRecordList(); | |||
// Bug 47001b: Expected an EXTERNSHEET record but got (org.apache.poi.hssf.record.SSTRecord) | |||
@@ -145,7 +145,7 @@ public final class TestLinkTable { | |||
new NameCommentRecord("name2", "comment2"), | |||
}; | |||
final List<Record> recList = Arrays.asList(recs); | |||
final List<org.apache.poi.hssf.record.Record> recList = Arrays.asList(recs); | |||
final WorkbookRecordList wrl = new WorkbookRecordList(); | |||
final Map<String, NameCommentRecord> commentRecords = new LinkedHashMap<>(); | |||
@@ -50,24 +50,24 @@ import org.junit.Test; | |||
* Unit test for the {@link InternalSheet} class. | |||
*/ | |||
public final class TestSheet { | |||
private static InternalSheet createSheet(List<Record> inRecs) { | |||
private static InternalSheet createSheet(List<org.apache.poi.hssf.record.Record> inRecs) { | |||
return InternalSheet.createSheet(new RecordStream(inRecs, 0)); | |||
} | |||
@Test | |||
public void testCreateSheet() { | |||
// Check we're adding row and cell aggregates | |||
List<Record> records = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
records.add(BOFRecord.createSheetBOF()); | |||
records.add( new DimensionsRecord() ); | |||
records.add(createWindow2Record()); | |||
records.add(EOFRecord.instance); | |||
InternalSheet sheet = createSheet(records); | |||
List<Record> outRecs = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> outRecs = new ArrayList<>(); | |||
sheet.visitContainedRecords(outRecs::add, 0); | |||
Iterator<Record> iter = outRecs.iterator(); | |||
Iterator<org.apache.poi.hssf.record.Record> iter = outRecs.iterator(); | |||
assertTrue(iter.next() instanceof BOFRecord ); | |||
assertTrue(iter.next() instanceof IndexRecord); | |||
assertTrue(iter.next() instanceof DimensionsRecord); | |||
@@ -75,7 +75,7 @@ public final class TestSheet { | |||
assertTrue(iter.next() instanceof EOFRecord); | |||
} | |||
private static Record createWindow2Record() { | |||
private static org.apache.poi.hssf.record.Record createWindow2Record() { | |||
WindowTwoRecord result = new WindowTwoRecord(); | |||
result.setOptions(( short ) 0x6b6); | |||
result.setTopRow(( short ) 0); | |||
@@ -93,7 +93,7 @@ public final class TestSheet { | |||
_count = 0; | |||
} | |||
@Override | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
if (r instanceof MergeCellsRecord) { | |||
_count++; | |||
} | |||
@@ -179,7 +179,7 @@ public final class TestSheet { | |||
*/ | |||
@Test | |||
public void testMovingMergedRegion() { | |||
List<Record> records = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
CellRangeAddress[] cras = { | |||
new CellRangeAddress(0, 1, 0, 2), | |||
@@ -218,7 +218,7 @@ public final class TestSheet { | |||
*/ | |||
@Test | |||
public void testRowAggregation() { | |||
List<Record> records = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
records.add(InternalSheet.createBOF()); | |||
records.add(new DimensionsRecord()); | |||
@@ -430,7 +430,7 @@ public final class TestSheet { | |||
@Test | |||
public void testUncalcSize_bug45066() { | |||
List<Record> records = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> records = new ArrayList<>(); | |||
records.add(BOFRecord.createSheetBOF()); | |||
records.add(new UncalcedRecord()); | |||
records.add(new DimensionsRecord()); | |||
@@ -510,7 +510,7 @@ public final class TestSheet { | |||
return _indexRecord; | |||
} | |||
@Override | |||
public void visitRecord(Record r) { | |||
public void visitRecord(org.apache.poi.hssf.record.Record r) { | |||
if (r instanceof IndexRecord) { | |||
if (_indexRecord != null) { | |||
throw new RuntimeException("too many index records"); | |||
@@ -588,7 +588,7 @@ public final class TestSheet { | |||
nr.setColumn((short) colIx); | |||
nr.setValue(3.0); | |||
List<Record> inRecs = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> inRecs = new ArrayList<>(); | |||
inRecs.add(BOFRecord.createSheetBOF()); | |||
inRecs.add(new RowRecord(rowIx)); | |||
inRecs.add(nr); | |||
@@ -596,7 +596,7 @@ public final class TestSheet { | |||
inRecs.add(EOFRecord.instance); | |||
InternalSheet sheet = createSheet(inRecs); | |||
List<Record> outRecs = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> outRecs = new ArrayList<>(); | |||
sheet.visitContainedRecords(outRecs::add, rowIx); | |||
assertEquals(8, outRecs.size()); | |||
DimensionsRecord dims = (DimensionsRecord) outRecs.get(5); | |||
@@ -643,7 +643,7 @@ public final class TestSheet { | |||
@Test | |||
public void testCloneMulBlank_bug46776() { | |||
Record[] recs = { | |||
org.apache.poi.hssf.record.Record[] recs = { | |||
InternalSheet.createBOF(), | |||
new DimensionsRecord(), | |||
new RowRecord(1), | |||
@@ -657,7 +657,7 @@ public final class TestSheet { | |||
InternalSheet sheet2 = sheet.cloneSheet(); | |||
List<Record> clonedRecs = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> clonedRecs = new ArrayList<>(); | |||
sheet2.visitContainedRecords(clonedRecs::add, 0); | |||
// +2 for INDEX and DBCELL | |||
assertEquals(recs.length+2, clonedRecs.size()); | |||
@@ -700,7 +700,7 @@ public final class TestSheet { | |||
r2.setStr(new HSSFRichTextString("Aggregated")); | |||
NoteRecord n2 = new NoteRecord(); | |||
List<Record> recordStream = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> recordStream = new ArrayList<>(); | |||
recordStream.add(InternalSheet.createBOF()); | |||
recordStream.add( d1 ); | |||
recordStream.add( r1 ); | |||
@@ -734,7 +734,7 @@ public final class TestSheet { | |||
confirmAggregatedRecords(recordStream); | |||
} | |||
private void confirmAggregatedRecords(List<Record> recordStream){ | |||
private void confirmAggregatedRecords(List<org.apache.poi.hssf.record.Record> recordStream){ | |||
InternalSheet sheet = InternalSheet.createSheet(); | |||
sheet.getRecords().clear(); | |||
sheet.getRecords().addAll(recordStream); | |||
@@ -745,10 +745,10 @@ public final class TestSheet { | |||
sheet.aggregateDrawingRecords(drawingManager, false); | |||
assertEquals(4, sheetRecords.size()); | |||
assertEquals(BOFRecord.sid, ((Record)sheetRecords.get(0)).getSid()); | |||
assertEquals(EscherAggregate.sid, ((Record)sheetRecords.get(1)).getSid()); | |||
assertEquals(WindowTwoRecord.sid, ((Record)sheetRecords.get(2)).getSid()); | |||
assertEquals(EOFRecord.sid, ((Record)sheetRecords.get(3)).getSid()); | |||
assertEquals(BOFRecord.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(0)).getSid()); | |||
assertEquals(EscherAggregate.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(1)).getSid()); | |||
assertEquals(WindowTwoRecord.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(2)).getSid()); | |||
assertEquals(EOFRecord.sid, ((org.apache.poi.hssf.record.Record)sheetRecords.get(3)).getSid()); | |||
} | |||
@Test |
@@ -53,7 +53,7 @@ public final class TestDrawingRecord { | |||
ContinueRecord cn = new ContinueRecord(data2); | |||
out.write(cn.serialize()); | |||
List<Record> rec = RecordFactory.createRecords(new ByteArrayInputStream(out.toByteArray())); | |||
List<org.apache.poi.hssf.record.Record> rec = RecordFactory.createRecords(new ByteArrayInputStream(out.toByteArray())); | |||
assertEquals(2, rec.size()); | |||
assertTrue(rec.get(0) instanceof DrawingRecord); | |||
assertTrue(rec.get(1) instanceof ContinueRecord); |
@@ -48,7 +48,7 @@ public final class TestFeatRecord { | |||
int countFRH = 0; | |||
// Check on the workbook, but shouldn't be there! | |||
for(Record r : wb.getRecords()) { | |||
for(org.apache.poi.hssf.record.Record r : wb.getRecords()) { | |||
if(r instanceof FeatRecord) { | |||
countFR++; | |||
} else if (r.getSid() == FeatRecord.sid) { | |||
@@ -70,7 +70,7 @@ public final class TestFeatRecord { | |||
for(RecordBase rb : sheet.getRecords()) { | |||
if(rb instanceof Record) { | |||
Record r = (Record)rb; | |||
Record r = (org.apache.poi.hssf.record.Record)rb; | |||
if(r instanceof FeatRecord) { | |||
countFR++; | |||
} else if (r.getSid() == FeatRecord.sid) { | |||
@@ -102,7 +102,7 @@ public final class TestFeatRecord { | |||
// First check it isn't on the Workbook | |||
int countFR = 0; | |||
int countFRH = 0; | |||
for(Record r : wb.getRecords()) { | |||
for(org.apache.poi.hssf.record.Record r : wb.getRecords()) { | |||
if(r instanceof FeatRecord) { | |||
fr = (FeatRecord)r; | |||
countFR++; | |||
@@ -125,7 +125,7 @@ public final class TestFeatRecord { | |||
for(RecordBase rb : sheet.getRecords()) { | |||
if(rb instanceof Record) { | |||
Record r = (Record)rb; | |||
Record r = (org.apache.poi.hssf.record.Record)rb; | |||
if(r instanceof FeatRecord) { | |||
fr = (FeatRecord)r; | |||
countFR++; |
@@ -52,7 +52,7 @@ public final class TestInterfaceEndRecord { | |||
"E2 00 02 00 B0 04 " + //INTERFACEEND with extra two bytes | |||
"0A 00 00 00"; // EOF | |||
byte[] data = HexRead.readFromString(hex); | |||
List<Record> records = RecordFactory.createRecords(new ByteArrayInputStream(data)); | |||
List<org.apache.poi.hssf.record.Record> records = RecordFactory.createRecords(new ByteArrayInputStream(data)); | |||
assertEquals(3, records.size()); | |||
Record rec1 = records.get(1); | |||
assertEquals(InterfaceHdrRecord.class, rec1.getClass()); |
@@ -59,7 +59,7 @@ public final class TestMergeCellsRecord { | |||
@Test | |||
public void testMCTable_bug46009() { | |||
MergedCellsTable mct = new MergedCellsTable(); | |||
List<Record> recList = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> recList = new ArrayList<>(); | |||
CellRangeAddress[] cras = new CellRangeAddress[] { | |||
new CellRangeAddress(0, 0, 0, 3), | |||
}; |
@@ -182,7 +182,7 @@ public final class TestRecordFactory { | |||
"00 00 00 00 00 00 00"; | |||
byte[] data = HexRead.readFromString(dump); | |||
List<Record> records = RecordFactory.createRecords(new ByteArrayInputStream(data)); | |||
List<org.apache.poi.hssf.record.Record> records = RecordFactory.createRecords(new ByteArrayInputStream(data)); | |||
assertEquals(5, records.size()); | |||
assertTrue(records.get(0) instanceof ObjRecord); | |||
assertTrue(records.get(1) instanceof DrawingRecord); | |||
@@ -192,7 +192,7 @@ public final class TestRecordFactory { | |||
//serialize and verify that the serialized data is the same as the original | |||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |||
for(Record rec : records){ | |||
for(org.apache.poi.hssf.record.Record rec : records){ | |||
out.write(rec.serialize()); | |||
} | |||
@@ -211,7 +211,7 @@ public final class TestRecordFactory { | |||
EOFRecord.instance, | |||
}; | |||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
for (Record rec : recs) { | |||
for (org.apache.poi.hssf.record.Record rec : recs) { | |||
try { | |||
baos.write(rec.serialize()); | |||
} catch (IOException e) { | |||
@@ -232,7 +232,7 @@ public final class TestRecordFactory { | |||
fs.createDocument(new ByteArrayInputStream(baos.toByteArray()), "dummy"); | |||
InputStream is = fs.getRoot().createDocumentInputStream("dummy"); | |||
List<Record> outRecs = RecordFactory.createRecords(is); | |||
List<org.apache.poi.hssf.record.Record> outRecs = RecordFactory.createRecords(is); | |||
// Buffer underrun - requested 512 bytes but 192 was available | |||
assertEquals(5, outRecs.size()); | |||
fs.close(); |
@@ -55,7 +55,7 @@ public final class TestCFRecordsAggregate { | |||
HSSFWorkbook workbook = new HSSFWorkbook(); | |||
HSSFSheet sheet = workbook.createSheet(); | |||
List<Record> recs = new ArrayList<>(); | |||
List<org.apache.poi.hssf.record.Record> recs = new ArrayList<>(); | |||
CFHeaderBase header = new CFHeaderRecord(); | |||
CFRuleBase rule1 = CFRuleRecord.create(sheet, "7"); | |||
CFRuleBase rule2 = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "2", "5"); |