/** * Constructs a Style record and Sets its fields appropriately. * @param in the RecordInputstream to Read the record from */ public StyleRecord(RecordInputStream in1) { fHighByte = BitFieldFactory.GetInstance(0x01); //have to init here, since we are being called //from base, and class level init hasnt been done. field_1_xf_index = in1.ReadShort(); if (Type == STYLE_BUILT_IN) { field_2_builtin_style = (byte)in1.ReadByte(); field_3_outline_style_level = (byte)in1.ReadByte(); } else if (Type == STYLE_USER_DEFINED) { field_2_name_length = in1.ReadShort(); // Some files from Crystal Reports lack // the remaining fields, which Is naughty if (in1.Remaining > 0) { field_3_string_options = (byte)in1.ReadByte(); byte[] str = in1.ReadRemainder(); if (fHighByte.IsSet(field_3_string_options)) { field_4_name = StringUtil.GetFromUnicodeBE(str, 0, field_2_name_length); } else { field_4_name = StringUtil.GetFromCompressedUnicode(str, 0, field_2_name_length); } } } // todo sanity Check exception to make sure we're one or the other }
private bool GetOptionFlag(BitField field) { return field.IsSet(field_5_options); }
private bool IsModified(BitField field) { return !field.IsSet(field_5_options); }
private bool GetFontOption(BitField field) { int options = GetInt(OFFSET_FONT_OPTIONS); return field.IsSet(options); }