/** * Constructs a MulRK record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public MulRKRecord(RecordInputStream in1) { field_1_row = in1.ReadUShort(); field_2_first_col = in1.ReadShort(); field_3_rks = RkRec.ParseRKs(in1); field_4_last_col = in1.ReadShort(); }
public int FillField(RecordInputStream in1) { short tokenSize = in1.ReadShort(); formulaTokens = Ptg.ReadTokens(tokenSize, in1); return tokenSize + 2; }
/** * Constructs a MulBlank record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public MulBlankRecord(RecordInputStream in1) { _row = in1.ReadUShort(); _first_col = in1.ReadShort(); _xfs = ParseXFs(in1); _last_col = in1.ReadShort(); }
public FeatRecord(RecordInputStream in1) { futureHeader = new FtrHeader(in1); isf_sharedFeatureType = in1.ReadShort(); reserved1 = (byte)in1.ReadByte(); reserved2 = in1.ReadInt(); int cref = in1.ReadUShort(); cbFeatData = in1.ReadInt(); reserved3 = in1.ReadShort(); cellRefs = new CellRangeAddress[cref]; for (int i = 0; i < cellRefs.Length; i++) { cellRefs[i] = new CellRangeAddress(in1); } switch (isf_sharedFeatureType) { case FeatHdrRecord.SHAREDFEATURES_ISFPROTECTION: sharedFeature = new FeatProtection(in1); break; case FeatHdrRecord.SHAREDFEATURES_ISFFEC2: sharedFeature = new FeatFormulaErr2(in1); break; case FeatHdrRecord.SHAREDFEATURES_ISFFACTOID: sharedFeature = new FeatSmartTag(in1); break; default: System.Console.WriteLine("Unknown Shared Feature " + isf_sharedFeatureType + " found!"); break; } }
public void FillFields(RecordInputStream in1) { this.field_Addr_number = in1.ReadShort(); this.field_regions_list = new ArrayList(this.field_Addr_number); for (int k = 0; k < this.field_Addr_number; k++) { short first_row = in1.ReadShort(); short first_col = in1.ReadShort(); short last_row = first_row; short last_col = first_col; if (in1.Remaining >= 4) { last_row = in1.ReadShort(); last_col = in1.ReadShort(); } else { // Ran out of data // For now, Issue a warning, finish, and // hope for the best.... logger.Log(POILogger.WARN, "Ran out of data reading cell references for DVRecord"); k = this.field_Addr_number; } AddrStructure region = new AddrStructure(first_row, first_col, last_row, last_col); this.field_regions_list.Add(region); } }
/** * Constructs a Guts record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public GutsRecord(RecordInputStream in1) { field_1_left_row_gutter = in1.ReadShort(); field_2_top_col_gutter = in1.ReadShort(); field_3_row_level_max = in1.ReadShort(); field_4_col_level_max = in1.ReadShort(); }
/** * Constructs a BoolErr record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public BoolErrRecord(RecordInputStream in1) : base(in1) { switch (in1.Remaining) { case 2: _value = in1.ReadByte(); break; case 3: _value = in1.ReadUShort(); break; default: throw new RecordFormatException("Unexpected size (" + in1.Remaining + ") for BOOLERR record."); } int flag = in1.ReadUByte(); switch (flag) { case 0: _isError = false; break; case 1: _isError = true; break; default: throw new RecordFormatException("Unexpected isError flag (" + flag + ") for BOOLERR record."); } }
/** * Constructs a ColumnInfo record and Sets its fields appropriately * @param in the RecordInputstream to Read the record from */ public ColumnInfoRecord(RecordInputStream in1) { _first_col = in1.ReadUShort(); _last_col = in1.ReadUShort(); _col_width = in1.ReadUShort(); _xf_index = in1.ReadUShort(); _options = in1.ReadUShort(); switch (in1.Remaining) { case 2: // usual case field_6_reserved = in1.ReadUShort(); break; case 1: // often COLINFO Gets encoded 1 byte short // shouldn't matter because this field Is Unused field_6_reserved = in1.ReadByte(); break; case 0: // According to bugzilla 48332, // "SoftArtisans OfficeWriter for Excel" totally skips field 6 // Excel seems to be OK with this, and assumes zero. field_6_reserved = 0; break; default: throw new Exception("Unusual record size remaining=(" + in1.Remaining + ")"); } }
/** * Constructs a Font record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public FontRecord(RecordInputStream in1) { field_1_font_height = in1.ReadShort(); field_2_attributes = in1.ReadShort(); field_3_color_palette_index = in1.ReadShort(); field_4_bold_weight = in1.ReadShort(); field_5_base_sub_script = in1.ReadShort(); field_6_underline = (byte)in1.ReadByte(); field_7_family = (byte)in1.ReadByte(); field_8_charset = (byte)in1.ReadByte(); field_9_zero = (byte)in1.ReadByte(); int field_10_font_name_len = (byte)in1.ReadByte(); int unicodeFlags = in1.ReadUByte(); // options byte present always (even if no character data) if (field_10_font_name_len > 0) { if (unicodeFlags == 0) { // Is compressed Unicode field_11_font_name = in1.ReadCompressedUnicode(field_10_font_name_len); } else { // Is not compressed Unicode field_11_font_name = in1.ReadUnicodeLEString(field_10_font_name_len); } } else { field_11_font_name = ""; } }
public ViewDefinitionRecord(RecordInputStream in1) { rwFirst = in1.ReadUShort(); rwLast = in1.ReadUShort(); colFirst = in1.ReadUShort(); colLast = in1.ReadUShort(); rwFirstHead = in1.ReadUShort(); rwFirstData = in1.ReadUShort(); colFirstData = in1.ReadUShort(); iCache = in1.ReadUShort(); reserved = in1.ReadUShort(); sxaxis4Data = in1.ReadUShort(); ipos4Data = in1.ReadUShort(); cDim = in1.ReadUShort(); cDimRw = in1.ReadUShort(); cDimCol = in1.ReadUShort(); cDimPg = in1.ReadUShort(); cDimData = in1.ReadUShort(); cRw = in1.ReadUShort(); cCol = in1.ReadUShort(); grbit = in1.ReadUShort(); itblAutoFmt = in1.ReadUShort(); int cchName = in1.ReadUShort(); int cchData = in1.ReadUShort(); name = StringUtil.ReadUnicodeString(in1, cchName); dataField = StringUtil.ReadUnicodeString(in1, cchData); }
public ExtendedPivotTableViewFieldsRecord(RecordInputStream in1) { grbit1 = in1.ReadInt(); grbit2 = in1.ReadUByte(); citmShow = in1.ReadUByte(); isxdiSort = in1.ReadUShort(); isxdiShow = in1.ReadUShort(); // This record seems to have different valid encodings switch (in1.Remaining) { case 0: // as per "Microsoft Excel Developer's Kit" book // older version of SXVDEX - doesn't seem to have a sub-total name reserved1 = 0; reserved2 = 0; subName = null; return; case 10: // as per "MICROSOFT OFFICE EXCEL 97-2007 BINARY FILE FORMAT SPECIFICATION" pdf break; default: throw new RecordFormatException("Unexpected remaining size (" + in1.Remaining + ")"); } int cchSubName = in1.ReadUShort(); reserved1 = in1.ReadInt(); reserved2 = in1.ReadInt(); if (cchSubName != STRING_NOT_PRESENT_LEN) { subName = in1.ReadUnicodeLEString(cchSubName); } }
/** * Constructs a Dimensions record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public DimensionsRecord(RecordInputStream in1) { field_1_first_row = in1.ReadInt(); field_2_last_row = in1.ReadInt(); field_3_first_col = in1.ReadShort(); field_4_last_col = in1.ReadShort(); field_5_zero = in1.ReadShort(); }
/** * @param in the RecordInputstream to Read the record from */ public SharedFormulaRecord(RecordInputStream in1) : base(in1) { field_5_reserved = in1.ReadShort(); int field_6_expression_len = in1.ReadShort(); int nAvailableBytes = in1.Available(); field_7_parsed_expr = Zephyr.Utils.NPOI.SS.Formula.Formula.Read(field_6_expression_len, in1, nAvailableBytes); }
public FtrHeader(RecordInputStream in1) { recordType = in1.ReadShort(); grbitFrt = in1.ReadShort(); reserved = new byte[8]; in1.Read(reserved, 0, 8); }
public CRNRecord(RecordInputStream in1) { field_1_last_column_index = in1.ReadByte() & 0x00FF; field_2_first_column_index = in1.ReadByte() & 0x00FF; field_3_row_index = in1.ReadShort(); int nValues = field_1_last_column_index - field_2_first_column_index + 1; field_4_constant_values = ConstantValueParser.Parse(in1, nValues); }
/** * Constructs a DVAL record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public DVALRecord(RecordInputStream in1) { this.field_1_options = in1.ReadShort(); this.field_2_horiz_pos = in1.ReadInt(); this.field_3_vert_pos = in1.ReadInt(); this.field_cbo_id = in1.ReadInt(); this.field_5_dv_no = in1.ReadInt(); }
/** * Constructs a TabID record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public TabIdRecord(RecordInputStream in1) { _tabids = new short[in1.Remaining / 2]; for (int k = 0; k < _tabids.Length; k++) { _tabids[k] = in1.ReadShort(); } }
/** * Constructs a WSBool record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public WSBoolRecord(RecordInputStream in1) { byte[] data = in1.ReadRemainder(); field_1_wsbool = data[0]; field_2_wsbool = data[1]; }
public CFHeaderRecord(RecordInputStream in1) { field_1_numcf = in1.ReadShort(); field_2_need_recalculation = in1.ReadShort(); field_3_enclosing_cell_range = new CellRangeAddress(in1); field_4_cell_ranges = new CellRangeAddressList(in1); }
/** * Constructs a ChartFormatRecord record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public ChartFormatRecord(RecordInputStream in1) { field1_x_position = in1.ReadInt(); field2_y_position = in1.ReadInt(); field3_width = in1.ReadInt(); field4_height = in1.ReadInt(); field5_grbit = in1.ReadShort(); field6_icrt = in1.ReadShort(); }
/** * Constructs a MMS record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public MMSRecord(RecordInputStream in1) { if (in1.Remaining == 0) { return; } field_1_AddMenuCount = (byte)in1.ReadByte(); field_2_delMenuCount = (byte)in1.ReadByte(); }
/** * Constructs a PaletteRecord record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public PaletteRecord(RecordInputStream in1) { short field_1_numcolors = in1.ReadShort(); field_2_colors = new List<PColor>(field_1_numcolors); for (int k = 0; k < field_1_numcolors; k++) { field_2_colors.Add(new PColor(in1)); } }
public FeatProtection(RecordInputStream in1) { fSD = in1.ReadInt(); passwordVerifier = in1.ReadInt(); title = StringUtil.ReadUnicodeString(in1); securityDescriptor = in1.ReadRemainder(); }
private static int ReadUShortAndCheck(RecordInputStream in1) { if (in1.Remaining < ENCODED_SIZE) { // Ran out of data throw new Exception("Ran out of data reading CellRangeAddress"); } return in1.ReadUShort(); }
/** * Constructs a Pane record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public PaneRecord(RecordInputStream in1) { field_1_x = in1.ReadShort(); field_2_y = in1.ReadShort(); field_3_topRow = in1.ReadShort(); field_4_leftColumn = in1.ReadShort(); field_5_activePane = in1.ReadShort(); }
public FeatHdrRecord(RecordInputStream in1) { futureHeader = new FtrHeader(in1); isf_sharedFeatureType = in1.ReadShort(); reserved = (byte)in1.ReadByte(); cbHdrData = in1.ReadInt(); // Don't process this just yet, need the BOFRecord rgbHdrData = in1.ReadRemainder(); }
private static RecordInputStream ConvertToInputStream(DrawingRecord r) { byte[] data = r.Serialize(); using (MemoryStream ms = new MemoryStream(data)) { RecordInputStream rinp = new RecordInputStream(ms); rinp.NextRecord(); return rinp; } }
public ArrayRecord(RecordInputStream in1) : base(in1) { _options = in1.ReadUShort(); _field3notUsed = in1.ReadInt(); int formulaTokenLen = in1.ReadUShort(); int totalFormulaLen = in1.Available(); _formula = Zephyr.Utils.NPOI.SS.Formula.Formula.Read(formulaTokenLen, in1, totalFormulaLen); }
/** * @param in the RecordInputstream to read the record from */ public CellRangeAddressList(RecordInputStream in1) { int nItems = in1.ReadUShort(); _list = new ArrayList(nItems); for (int k = 0; k < nItems; k++) { _list.Add(new CellRangeAddress(in1)); } }
public CRNCountRecord(RecordInputStream in1) { field_1_number_crn_records = in1.ReadShort(); if (field_1_number_crn_records < 0) { // TODO - seems like the sign bit of this field might be used for some other purpose // see example file for test case "TestBugs.test19599()" field_1_number_crn_records = (short)-field_1_number_crn_records; } field_2_sheet_table_index = in1.ReadShort(); }
/** * Constructs a PasswordRev4 (PROT4REVPASS) record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public PasswordRev4Record(RecordInputStream in1) { field_1_password = in1.ReadShort(); }
/** * Constructs a CodepageRecord and Sets its fields appropriately * @param in the RecordInputstream to Read the record from */ public CodepageRecord(RecordInputStream in1) { field_1_codepage = in1.ReadShort(); }
public DrawingGroupRecord(RecordInputStream in1) : base(in1) { }
/** * Constructs a PrintGridlines record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public PrintGridlinesRecord(RecordInputStream in1) { field_1_print_gridlines = in1.ReadShort(); }
/** * Constructs an Iteration record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public IterationRecord(RecordInputStream in1) { _flags = in1.ReadShort(); }
private RkRec(RecordInputStream in1) { xf = in1.ReadShort(); rk = in1.ReadInt(); }
/** * Constructs a Protect record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public ProtectRecord(RecordInputStream in1) : this(in1.ReadShort()) { }
/** * Constructs a Delta record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public DeltaRecord(RecordInputStream in1) { field_1_max_change = in1.ReadDouble(); }
/** * Constructs a BookBoolRecord and Sets its fields appropriately * @param in the RecordInputstream to Read the record from */ public BookBoolRecord(RecordInputStream in1) { field_1_save_link_values = in1.ReadShort(); }
/** * Constructs a DateWindow1904 record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public DateWindow1904Record(RecordInputStream in1) { field_1_window = in1.ReadShort(); }
/** * Main constructor -- kinda dummy because we don't validate or fill fields * * @param in the RecordInputstream to Read the record from */ public ContinueRecord(RecordInputStream in1) { field_1_data = in1.ReadRemainder(); }
/** * @param in the RecordInputstream to Read the record from */ public HorizontalPageBreakRecord(RecordInputStream in1) : base(in1) { }
protected CellRecord(RecordInputStream in1) { _rowIndex = in1.ReadUShort(); _columnIndex = in1.ReadUShort(); _formatIndex = in1.ReadUShort(); }
public TextObjectRecord(RecordInputStream in1) { field_1_options = in1.ReadUShort(); field_2_textOrientation = in1.ReadUShort(); field_3_reserved4 = in1.ReadUShort(); field_4_reserved5 = in1.ReadUShort(); field_5_reserved6 = in1.ReadUShort(); int field_6_textLength = in1.ReadUShort(); int field_7_formattingDataLength = in1.ReadUShort(); field_8_reserved7 = in1.ReadInt(); if (in1.Remaining > 0) { // Text Objects can have simple reference formulas // (This bit not mentioned in the MS document) if (in1.Remaining < 11) { throw new RecordFormatException("Not enough remaining data for a link formula"); } int formulaSize = in1.ReadUShort(); _unknownPreFormulaInt = in1.ReadInt(); Ptg[] ptgs = Ptg.ReadTokens(formulaSize, in1); if (ptgs.Length != 1) { throw new RecordFormatException("Read " + ptgs.Length + " tokens but expected exactly 1"); } _linkRefPtg = (OperandPtg)ptgs[0]; if (in1.Remaining > 0) { _unknownPostFormulaByte = (byte)in1.ReadByte(); } else { _unknownPostFormulaByte = null; } } else { _linkRefPtg = null; } if (in1.Remaining > 0) { throw new RecordFormatException("Unused " + in1.Remaining + " bytes at end of record"); } String text; if (field_6_textLength > 0) { text = ReadRawString(in1, field_6_textLength); } else { text = ""; } _text = new HSSFRichTextString(text); if (field_7_formattingDataLength > 0) { ProcessFontRuns(in1, _text, field_7_formattingDataLength); } }
/// <summary> /// Initializes a new instance of the <see cref="FooterRecord"/> class. /// </summary> /// <param name="in1">the RecordInputstream to Read the record from</param> public FooterRecord(RecordInputStream in1) : base(in1) { }
/** * Constructs a OBJ record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public ObjRecord(RecordInputStream in1) { // TODO - problems with OBJ sub-records stream // MS spec says first sub-record is always CommonObjectDataSubRecord, // and last is // always EndSubRecord. OOO spec does not mention ObjRecord(0x005D). // Existing POI test data seems to violate that rule. Some test data // seems to contain // garbage, and a crash is only averted by stopping at what looks like // the 'EndSubRecord' //Check if this can be continued, if so then the //following wont work properly //int subSize = 0; byte[] subRecordData = in1.ReadRemainder(); if (LittleEndian.GetUShort(subRecordData, 0) != CommonObjectDataSubRecord.sid) { // seems to occur in just one junit on "OddStyleRecord.xls" (file created by CrystalReports) // Excel tolerates the funny ObjRecord, and replaces it with a corrected version // The exact logic/reasoning is not yet understood _uninterpretedData = subRecordData; subrecords = null; return; } //if (subRecordData.Length % 2 != 0) //{ // String msg = "Unexpected length of subRecordData : " + HexDump.ToHex(subRecordData); // throw new RecordFormatException(msg); //} subrecords = new List <SubRecord>(); using (MemoryStream bais = new MemoryStream(subRecordData)) { LittleEndianInputStream subRecStream = new LittleEndianInputStream(bais); CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)SubRecord.CreateSubRecord(subRecStream, 0); subrecords.Add(cmo); while (true) { SubRecord subRecord = SubRecord.CreateSubRecord(subRecStream, cmo.ObjectType); subrecords.Add(subRecord); if (subRecord.IsTerminating) { break; } } int nRemainingBytes = subRecStream.Available(); if (nRemainingBytes > 0) { // At present (Oct-2008), most unit test samples have (subRecordData.length % 2 == 0) _isPaddedToQuadByteMultiple = subRecordData.Length % MAX_PAD_ALIGNMENT == 0; if (nRemainingBytes >= (_isPaddedToQuadByteMultiple ? MAX_PAD_ALIGNMENT : NORMAL_PAD_ALIGNMENT)) { if (!CanPaddingBeDiscarded(subRecordData, nRemainingBytes)) { String msg = "Leftover " + nRemainingBytes + " bytes in subrecord data " + HexDump.ToHex(subRecordData); throw new RecordFormatException(msg); } _isPaddedToQuadByteMultiple = false; } } else { _isPaddedToQuadByteMultiple = false; } _uninterpretedData = null; } }
/** * Constructs an HideObj record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public HideObjRecord(RecordInputStream in1) { field_1_hide_obj = in1.ReadShort(); }
/// <summary> /// Constructs a DefaultRowHeight record and Sets its fields appropriately. /// </summary> /// <param name="in1">the RecordInputstream to Read the record from</param> public DefaultRowHeightRecord(RecordInputStream in1) { field_1_option_flags = in1.ReadShort(); field_2_row_height = in1.ReadShort(); }
/** * Constructs a RK record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public RKRecord(RecordInputStream in1) : base(in1) { field_4_rk_number = in1.ReadInt(); }
/** * Read constructor */ public UncalcedRecord(RecordInputStream in1) { _reserved = in1.ReadShort(); }
/** * Constructs a SCL record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public SCLRecord(RecordInputStream in1) { field_1_numerator = in1.ReadShort(); field_2_denominator = in1.ReadShort(); }
/** * Constructs a Protect record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public ScenarioProtectRecord(RecordInputStream in1) { field_1_protect = in1.ReadShort(); }
/** * Constructs a VCENTER record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public VCenterRecord(RecordInputStream in1) { field_1_vcenter = in1.ReadShort(); }
/** * Constructs a CountryRecord and Sets its fields appropriately * @param in the RecordInputstream to Read the record from */ public CountryRecord(RecordInputStream in1) { field_1_default_country = in1.ReadShort(); field_2_current_country = in1.ReadShort(); }
/** * Constructs an Codepage record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public InterfaceHdrRecord(RecordInputStream in1) { _codepage = in1.ReadShort(); }
/** * Constructs a RefreshAll record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public RefreshAllRecord(RecordInputStream in1) : this(in1.ReadUShort()) { }
private static byte[] Read(RecordInputStream in1, int size) { byte[] result = new byte[size]; in1.ReadFully(result); return(result); }
/** * Constructs a RightMargin record and Sets its fields appropriately. * * @param id id must be 0x27 or an exception * will be throw upon validation * @param size size the size of the data area of the record * @param data data of the record (should not contain sid/len) */ public RightMarginRecord(RecordInputStream in1) { field_1_margin = in1.ReadDouble(); }
/** * Constructs a BlankRecord and Sets its fields appropriately * @param in the RecordInputstream to Read the record from */ public BlankRecord(RecordInputStream in1) { field_1_row = in1.ReadUShort(); field_2_col = in1.ReadShort(); field_3_xf = in1.ReadShort(); }
/** * construct an UserSViewEnd record. No fields are interpreted and the record will * be Serialized in its original form more or less * @param in the RecordInputstream to read the record from */ public UserSViewEnd(RecordInputStream in1) { _rawData = in1.ReadRemainder(); }