/// <summary> Constructor /// /// </summary> /// <param name="offset">the offset in the raw file /// </param> /// <param name="f">the excel 97 biff file /// </param> /// <param name="d">the data record /// </param> internal Record(sbyte[] d, int offset, File f) { code = IntegerHelper.getInt(d[offset], d[offset + 1]); length = IntegerHelper.getInt(d[offset + 2], d[offset + 3]); file = f; file.skip(4); dataPos = f.Pos; file.skip(length); type = NExcel.Biff.Type.getType(code); }
/// <summary> Rationalizes the sheets xf index mapping</summary> /// <param name="xfMapping">the index mapping for XFRecords /// </param> /// <param name="fontMapping">the index mapping for fonts /// </param> /// <param name="formatMapping">the index mapping for formats /// </param> public virtual void rationalize(IndexMapping xfMapping, IndexMapping fontMapping, IndexMapping formatMapping) { if (!initialized) { initialize(); } // Read through the array, looking for the data types // This is a total hack bodge for now - it will eventually need to be // integrated properly int pos = 0; int code = 0; int length = 0; NExcel.Biff.Type type = null; while (pos < data.Length) { code = IntegerHelper.getInt(data[pos], data[pos + 1]); length = IntegerHelper.getInt(data[pos + 2], data[pos + 3]); type = NExcel.Biff.Type.getType(code); if (type == NExcel.Biff.Type.FONTX) { int fontind = IntegerHelper.getInt(data[pos + 4], data[pos + 5]); IntegerHelper.getTwoBytes(fontMapping.getNewIndex(fontind), data, pos + 4); } else if (type == NExcel.Biff.Type.FBI) { int fontind = IntegerHelper.getInt(data[pos + 12], data[pos + 13]); IntegerHelper.getTwoBytes(fontMapping.getNewIndex(fontind), data, pos + 12); } else if (type == NExcel.Biff.Type.IFMT) { int formind = IntegerHelper.getInt(data[pos + 4], data[pos + 5]); IntegerHelper.getTwoBytes(formatMapping.getNewIndex(formind), data, pos + 4); } pos += length + 4; } }
/// <summary> Constructs this record from the raw data /// /// </summary> /// <param name="t">the type /// </param> /// <param name="r">the record /// </param> protected internal MarginRecord(NExcel.Biff.Type t, Record r) : base(t) { sbyte[] data = r.Data; margin = DoubleHelper.getIEEEDouble(data, 0); }