/** * These records may occur between the 'Worksheet Protection Block' and DIMENSION: * <pre> * o DEFCOLWIDTH * oo COLINFO * o SORT * </pre> */ private static boolean isProtectionSubsequentRecord(Object rb) { if (rb instanceof ColumnInfoRecordsAggregate) { return true; // oo COLINFO } if (rb instanceof Record) { Record record = (Record) rb; switch (record.getSid()) { case DefaultColWidthRecord.sid: case UnknownRecord.SORT_0090: return true; } } return false; }
public void visitRecord(Record r) { try { _destList.add((Record)r.clone()); } catch (CloneNotSupportedException e) { throw new RecordFormatException(e); } } }
public int getSize() { int retval = 0; SSTRecord lSST = null; for ( Record record : records.getRecords() ) { if (record instanceof SSTRecord) { lSST = (SSTRecord)record; } if (record.getSid() == ExtSSTRecord.sid && lSST != null) { retval += lSST.calcExtSSTRecordSize(); } else { retval += record.getRecordSize(); } } return retval; }
/** * called by the class that is responsible for writing this sucker. * Subclasses should implement this so that their data is passed back in a * byte array. * * @return byte array containing instance data */ public final byte[] serialize() { byte[] retval = new byte[ getRecordSize() ]; serialize(0, retval); return retval; }
public void visitRecord(Record r) { _totalSize += r.getRecordSize(); } }
public int serialize(int offset, byte[] data) { int result = 0; for (Record rec : _list) { result += rec.serialize(offset + result, data); } return result; } }
public void processRecord(Record rec) { System.out.println(rec.toString()); } });
@Override public void visitRecord(Record r) { _list.add(r); _totalSize+=r.getRecordSize(); } public int serialize(int offset, byte[] data) {
/** * called by the class that is responsible for writing this sucker. * Subclasses should implement this so that their data is passed back in a * byte array. * * @return byte array containing instance data */ public final byte[] serialize() { byte[] retval = new byte[ getRecordSize() ]; serialize(0, retval); return retval; }
public void visitRecord(Record r) { int currentOffset = _startOffset + _countBytesWritten; _countBytesWritten += r.serialize(currentOffset, _data); } }
public void processRecord(Record rec) { System.out.println(rec.toString()); } });
private static boolean isDVTPriorRecord(RecordBase rb) { if (rb instanceof MergedCellsTable || rb instanceof ConditionalFormattingTable) { return true; } short sid = ((Record)rb).getSid(); switch(sid) { case WindowTwoRecord.sid: case UnknownRecord.SCL_00A0: case PaneRecord.sid: case SelectionRecord.sid: case UnknownRecord.STANDARDWIDTH_0099: // MergedCellsTable case UnknownRecord.LABELRANGES_015F: case UnknownRecord.PHONETICPR_00EF: // ConditionalFormattingTable case HyperlinkRecord.sid: case UnknownRecord.QUICKTIP_0800: // name of a VBA module case UnknownRecord.CODENAME_1BA: return true; } return false; }
public int getSize() { int retval = 0; SSTRecord lSST = null; for ( Record record : records.getRecords() ) { if (record instanceof SSTRecord) { lSST = (SSTRecord)record; } if (record.getSid() == ExtSSTRecord.sid && lSST != null) { retval += lSST.calcExtSSTRecordSize(); } else { retval += record.getRecordSize(); } } return retval; }
public void visitRecord(Record r) { _position += r.getRecordSize(); _rv.visitRecord(r); } public void setPosition(int position) {
/** * called by the class that is responsible for writing this sucker. * Subclasses should implement this so that their data is passed back in a * byte array. * * @return byte array containing instance data */ public final byte[] serialize() { byte[] retval = new byte[ getRecordSize() ]; serialize(0, retval); return retval; }