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 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(); }
public TableRecord(RecordInputStream in1) : base(in1) { field_5_flags = in1.ReadByte(); field_6_res = in1.ReadByte(); field_7_rowInputRow = in1.ReadShort(); field_8_colInputRow = in1.ReadShort(); field_9_rowInputCol = in1.ReadShort(); field_10_colInputCol = in1.ReadShort(); }
public ChartFRTInfoRecord(RecordInputStream in1) { rt = in1.ReadShort(); grbitFrt = in1.ReadShort(); verOriginator = (byte)in1.ReadByte(); verWriter = (byte)in1.ReadByte(); int cCFRTID = in1.ReadShort(); rgCFRTID = new CFRTID[cCFRTID]; for (int i = 0; i < cCFRTID; i++) { rgCFRTID[i] = new CFRTID(in1); } }
/** * 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 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."); } }
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; } }
/** * Constructs a Tick record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public TickRecord(RecordInputStream in1) { field_1_majorTickType = (byte)in1.ReadByte(); field_2_minorTickType = (byte)in1.ReadByte(); field_3_labelPosition = (byte)in1.ReadByte(); field_4_background = (byte)in1.ReadByte(); field_5_labelColorRgb = (byte)in1.ReadInt(); field_6_zero1 = in1.ReadInt(); field_7_zero2 = in1.ReadInt(); field_8_zero3 = in1.ReadInt(); field_9_zero4 = in1.ReadInt(); field_10_options = in1.ReadShort(); field_11_tickColor = in1.ReadShort(); field_12_zero5 = in1.ReadShort(); }
/** * Constructs a Style record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public StyleRecord(RecordInputStream in1) { field_1_xf_index = in1.ReadShort(); if (IsBuiltin) { field_2_builtin_style = in1.ReadByte(); field_3_outline_style_level = in1.ReadByte(); } else { int field_2_name_length = in1.ReadShort(); // Some files from Crystal Reports lack // the remaining fields, which Is naughty if (in1.Remaining <1) { // Some files from Crystal Reports lack the is16BitUnicode byte // the remaining fields, which is naughty if (field_2_name_length != 0) { throw new RecordFormatException("Ran out of data reading style record"); } // guess this is OK if the string length is zero field_4_name = ""; } else { field_3_stringHasMultibyte = in1.ReadByte() != 0x00; if (field_3_stringHasMultibyte) { field_4_name = StringUtil.ReadUnicodeLE(in1, field_2_name_length); } else { field_4_name = StringUtil.ReadCompressedUnicode(in1,field_2_name_length); } } } // todo sanity Check exception to make sure we're one or the other }
/** * Constructs a String record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public StringRecord(RecordInputStream in1) { int field_1_string_length = in1.ReadShort(); _is16bitUnicode = in1.ReadByte() != 0x00; if (_is16bitUnicode) { _text = in1.ReadUnicodeLEString(field_1_string_length); } else { _text = in1.ReadCompressedUnicode(field_1_string_length); } }
/// <summary> /// Constructs a Selection record and Sets its fields appropriately. /// </summary> /// <param name="in1">the RecordInputstream to Read the record from</param> public SelectionRecord(RecordInputStream in1) { field_1_pane = (byte)in1.ReadByte(); field_2_row_active_cell = in1.ReadUShort(); field_3_col_active_cell = in1.ReadShort(); field_4_ref_active_cell = in1.ReadShort(); int field_5_num_refs = in1.ReadUShort(); field_6_refs = new CellRangeAddress8Bit[field_5_num_refs]; for (int i = 0; i < field_5_num_refs; i++) { field_6_refs[i] = new CellRangeAddress8Bit(in1); } }
/** * Constructs a Format record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public FormatRecord(RecordInputStream in1) { field_1_index_code = in1.ReadShort(); int field_3_unicode_len = in1.ReadShort(); field_3_hasMultibyte = (in1.ReadByte() & (byte)0x01) != 0; if (field_3_hasMultibyte) { // Unicode field_4_formatstring = in1.ReadUnicodeLEString(field_3_unicode_len); } else { // not Unicode field_4_formatstring = in1.ReadCompressedUnicode(field_3_unicode_len); } }
/** * Constructs a <c>NoteRecord</c> and Fills its fields * from the supplied <c>RecordInputStream</c>. * * @param in the stream to Read from */ public NoteRecord(RecordInputStream in1) { field_1_row = in1.ReadShort(); field_2_col = in1.ReadUShort(); field_3_flags = in1.ReadShort(); field_4_shapeid = in1.ReadUShort(); int length = in1.ReadShort(); field_5_hasMultibyte = in1.ReadByte() != 0x00; if (field_5_hasMultibyte) { field_6_author = StringUtil.ReadUnicodeLE(in1, length); } else { field_6_author = StringUtil.ReadCompressedUnicode(in1, length); } if (in1.Available() == 1) { field_7_padding = (byte)in1.ReadByte(); } }
/** * Constructs a FileSharing record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public FileSharingRecord(RecordInputStream in1) { field_1_Readonly = in1.ReadShort(); field_2_password = in1.ReadShort(); int nameLen = in1.ReadShort(); if (nameLen > 0) { // TODO - Current examples(3) from junits only have zero Length username. field_3_username_unicode_options = (byte)in1.ReadByte(); field_3_username_value = in1.ReadCompressedUnicode(nameLen); } else { field_3_username_value = ""; } }
public ViewFieldsRecord(RecordInputStream in1) { sxaxis = in1.ReadShort(); cSub = in1.ReadShort(); grbitSub = in1.ReadShort(); cItm = in1.ReadShort(); int cchName = in1.ReadUShort(); if (cchName != STRING_NOT_PRESENT_LEN) { int flag = in1.ReadByte(); if ((flag & 0x01) != 0) { _name = in1.ReadUnicodeLEString(cchName); } else { _name = in1.ReadCompressedUnicode(cchName); } } }
/** * Constructs an Label record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public LabelRecord(RecordInputStream in1) { field_1_row = in1.ReadUShort(); field_2_column = in1.ReadUShort(); field_3_xf_index = in1.ReadShort(); field_4_string_len = in1.ReadShort(); field_5_unicode_flag = (byte)in1.ReadByte(); if (field_4_string_len > 0) { if (IsUncompressedUnicode) { field_6_value = in1.ReadUnicodeLEString(field_4_string_len); } else { field_6_value = in1.ReadCompressedUnicode(field_4_string_len); } } else { field_6_value = ""; } }
protected HeaderFooterBase(RecordInputStream in1) { if (in1.Remaining > 0) { int field_1_footer_len = in1.ReadShort(); field_2_hasMultibyte = in1.ReadByte() != 0x00; if (field_2_hasMultibyte) { field_3_text = in1.ReadUnicodeLEString(field_1_footer_len); } else { field_3_text = in1.ReadCompressedUnicode(field_1_footer_len); } } else { // Note - this is unusual for BIFF records in general, but normal for header / footer records: // when the text is empty string, the whole record is empty (just the 4 byte BIFF header) field_3_text = ""; } }
/** * Constructs a Text record and Sets its fields appropriately. * * @param in the RecordInputstream to Read the record from */ public TextRecord(RecordInputStream in1) { field_1_horizontalAlignment = (byte)in1.ReadByte(); field_2_verticalAlignment = (byte)in1.ReadByte(); field_3_DisplayMode = in1.ReadShort(); field_4_rgbColor = in1.ReadInt(); field_5_x = in1.ReadInt(); field_6_y = in1.ReadInt(); field_7_width = in1.ReadInt(); field_8_height = in1.ReadInt(); field_9_options1 = in1.ReadShort(); field_10_IndexOfColorValue = in1.ReadShort(); field_11_options2 = in1.ReadShort(); field_12_textRotation = in1.ReadShort(); }
public CFRuleRecord(RecordInputStream in1) { field_1_condition_type = (byte)in1.ReadByte(); field_2_comparison_operator = (byte)in1.ReadByte(); int field_3_formula1_len = in1.ReadUShort(); int field_4_formula2_len = in1.ReadUShort(); field_5_options = in1.ReadInt(); field_6_not_used = in1.ReadShort(); if (ContainsFontFormattingBlock) { fontFormatting = new FontFormatting(in1); } if (ContainsBorderFormattingBlock) { borderFormatting = new BorderFormatting(in1); } if (ContainsPatternFormattingBlock) { patternFormatting = new PatternFormatting(in1); } field_17_formula1 = FR.Formula.Read(field_3_formula1_len, in1); field_18_formula2 = FR.Formula.Read(field_4_formula2_len, in1); }
/** Creates new FontFormatting */ public FontFormatting(RecordInputStream in1):this(new byte[RAW_DATA_SIZE]) { for (int i = 0; i < _rawData.Length; i++) { _rawData[i] =(byte) in1.ReadByte(); } }
/** * 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 = ""; } }
private static String ReadRawString(RecordInputStream in1, int textLength) { byte compressByte = (byte)in1.ReadByte(); bool isCompressed = (compressByte & 0x01) == 0; if (isCompressed) { return in1.ReadCompressedUnicode(textLength); } return in1.ReadUnicodeLEString(textLength); }
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(); }
public PColor(RecordInputStream in1) { _red = (byte)in1.ReadByte(); _green = (byte)in1.ReadByte(); _blue = (byte)in1.ReadByte(); in1.ReadByte(); // unused }
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); } }