private static CFHeaderBase createHeader(CellRangeAddress[] regions, CFRuleBase[] rules) { final CFHeaderBase header; if (rules.length == 0 || rules[0] instanceof CFRuleRecord) { header = new CFHeaderRecord(regions, rules.length); } else { header = new CFHeader12Record(regions, rules.length); } // set the "needs recalculate" by default to avoid Excel handling conditional formatting incorrectly // see bug 52122 for details header.setNeedRecalculation(true); return header; }
public DrawingSelectionRecord(RecordInputStream in) { _header = new OfficeArtRecordHeader(in); _cpsp = in.readInt(); _dgslk = in.readInt(); _spidFocus = in.readInt(); int nShapes = in.available() / 4; int[] shapeIds = new int[nShapes]; for (int i = 0; i < nShapes; i++) { shapeIds[i] = in.readInt(); } _shapeIds = shapeIds; }
/** * @param in the RecordInputstream to read the record from */ public MulRKRecord(RecordInputStream in) { field_1_row = in.readUShort(); field_2_first_col = in.readShort(); field_3_rks = RkRec.parseRKs(in); field_4_last_col = in.readShort(); }
@Override protected ObjRecord createObjRecord() { ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.setObjectType(HSSFTextbox.OBJECT_TYPE_TEXT); c.setLocked(true); c.setPrintable(true); c.setAutofill(true); c.setAutoline(true); EndSubRecord e = new EndSubRecord(); obj.addSubRecord(c); obj.addSubRecord(e); return obj; }
protected void serialize(ContinuableRecordOutput out) { SSTSerializer serializer = new SSTSerializer(field_3_strings, getNumStrings(), getNumUniqueStrings() ); serializer.serialize(out); bucketAbsoluteOffsets = serializer.getBucketAbsoluteOffsets(); bucketRelativeOffsets = serializer.getBucketRelativeOffsets(); }
private MulBlankRecord createMBR(CellValueRecordInterface[] cellValues, int startIx, int nBlank) { short[] xfs = new short[nBlank]; for (int i = 0; i < xfs.length; i++) { xfs[i] = cellValues[startIx + i].getXFIndex(); } int rowIx = cellValues[startIx].getRow(); return new MulBlankRecord(rowIx, startIx, xfs); }
public FormatRecord(RecordInputStream in) { field_1_index_code = in.readShort(); int field_3_unicode_len = in.readUShort(); field_3_hasMultibyte = (in.readByte() & 0x01) != 0; if (field_3_hasMultibyte) { field_4_formatstring = readStringCommon(in, field_3_unicode_len, false); } else { field_4_formatstring = readStringCommon(in, field_3_unicode_len, true); } }
@Override public ObjRecord clone() { ObjRecord rec = new ObjRecord(); for (SubRecord record : subrecords) { rec.addSubRecord(record.clone()); } return rec; } }
@Override public CFRuleRecord clone() { CFRuleRecord rec = new CFRuleRecord(getConditionType(), getComparisonOperation()); super.copyTo(rec); return rec; } }
/** * @param in the RecordInputstream to read the record from */ public MulBlankRecord(RecordInputStream in) { _row = in.readUShort(); _firstCol = in.readShort(); _xfs = parseXFs(in); _lastCol = in.readShort(); }
/** * @param refIndex specifies the n-th refIndex * * @return the index of the SupBookRecord for this index */ public int getExtbookIndexFromRefIndex(int refIndex) { RefSubRecord refRec = getRef(refIndex); return refRec.getExtBookIndex(); }
/** * Sets the comment the user provided when the name was created. * * @param comment the user comment for this named range */ public void setComment(String comment){ // Update the main record _definedNameRec.setDescriptionText(comment); // If we have a comment record too, update that as well if(_commentRec != null) { _commentRec.setCommentText(comment); } }
/** * Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc. * * @param address the address of this hyperlink */ public void setAddress(String address) { if ((_linkOpts & HLINK_URL) != 0 && FILE_MONIKER.equals(_moniker)) { _shortFilename = appendNullTerm(address); } else if((_linkOpts & HLINK_PLACE) != 0) { _textMark = appendNullTerm(address); } else { _address = appendNullTerm(address); } }
/** * Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc. * * @return the address of this hyperlink */ public String getAddress() { if ((_linkOpts & HLINK_URL) != 0 && FILE_MONIKER.equals(_moniker)) { return cleanString(_address != null ? _address : _shortFilename); } else if((_linkOpts & HLINK_PLACE) != 0) { return cleanString(_textMark); } else { return cleanString(_address); } }
@Override public CFHeaderRecord clone() { CFHeaderRecord result = new CFHeaderRecord(); super.copyTo(result); return result; } }
public String toString() { return "[SAVERECALC]\n" + " .recalc = " + getRecalc() + "\n" + "[/SAVERECALC]\n"; }
public Object clone() { RowRecord rec = new RowRecord(field_1_row_number); rec.field_2_first_col = field_2_first_col; rec.field_3_last_col = field_3_last_col; rec.field_4_height = field_4_height; rec.field_5_optimize = field_5_optimize; rec.field_6_reserved = field_6_reserved; rec.field_7_option_flags = field_7_option_flags; rec.field_8_option_flags = field_8_option_flags; return rec; } }
@Override protected ObjRecord createObjRecord() { ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.setLocked(true); c.setPrintable(true); c.setAutofill(true); c.setAutoline(true); EndSubRecord e = new EndSubRecord(); obj.addSubRecord(c); obj.addSubRecord(e); return obj; }