예제 #1
0
        /**
         * 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
        }
예제 #2
0
 private bool GetOptionFlag(BitField field)
 {
     return field.IsSet(field_5_options);
 }
예제 #3
0
 private bool IsModified(BitField field)
 {
     return !field.IsSet(field_5_options);
 }
예제 #4
0
파일: FontFormatting.cs 프로젝트: WPG/npoi
 private bool GetFontOption(BitField field)
 {
     int options = GetInt(OFFSET_FONT_OPTIONS);
     return field.IsSet(options);
 }