public IFont AppendTextRun(string value, bool replaceInvalidWhiteSpace)
 {
     if (this.m_font != null)
     {
         int num = this.m_styleContainer.AddFont(this.m_font);
         this.m_maxFontIndex = Math.Max(this.m_maxFontIndex, num);
         this.m_fontList.Add(new Pair <int, int>(this.m_startIndex, num));
     }
     this.m_startIndex = this.m_stringBuilder.Length;
     if (replaceInvalidWhiteSpace)
     {
         this.AppendWithChecking(value);
     }
     else
     {
         this.m_stringBuilder.Append(value);
     }
     if (this.m_firstRun)
     {
         this.m_firstRun = false;
         return(this.m_styleContainer);
     }
     this.m_font = new BIFF8Font();
     return(this.m_font);
 }
        public object Clone()
        {
            BIFF8Font bIFF8Font = (BIFF8Font)base.MemberwiseClone();

            bIFF8Font.m_data = (byte[])this.m_data.Clone();
            bIFF8Font.m_hash = 0;
            return(bIFF8Font);
        }
        public int AddStyle(StyleProperties props)
        {
            BIFF8Style bIFF8Style = new BIFF8Style(props);
            BIFF8Font  font       = new BIFF8Font(props);

            bIFF8Style.Ifnt = this.AddFont(font);
            bIFF8Style.Ifmt = this.AddFormat(props.NumberFormat);
            return(this.AddStyle(bIFF8Style));
        }
 public RichTextInfo(StyleContainer styleContainer)
 {
     this.m_styleContainer = styleContainer;
     this.m_startIndex     = 0;
     this.m_font           = null;
     this.m_fontList       = new List <Pair <int, int> >();
     this.m_stringBuilder  = new StringBuilder();
     this.m_maxFontIndex   = 0;
     this.m_firstRun       = true;
 }
        public int AddFont(BIFF8Font font)
        {
            int num = default(int);

            if (!this.m_fontMap.TryGetValue(font, out num))
            {
                num = this.m_fonts.Count + 5;
                this.m_fontMap.Add(font, num);
                this.m_fonts.Add(font);
            }
            return(num);
        }
        public StringWrapperBIFF8 CompleteRun()
        {
            if (this.m_font != null)
            {
                int num = this.m_styleContainer.AddFont(this.m_font);
                this.m_maxFontIndex = Math.Max(this.m_maxFontIndex, num);
                this.m_fontList.Add(new Pair <int, int>(this.m_startIndex, num));
            }
            StringWrapperBIFF8 stringWrapperBIFF = new StringWrapperBIFF8(this.m_stringBuilder.ToString());

            stringWrapperBIFF.SetRunsList(this.m_fontList);
            this.m_fontList      = null;
            this.m_font          = null;
            this.m_stringBuilder = null;
            return(stringWrapperBIFF);
        }
        public override bool Equals(object target)
        {
            BIFF8Font bIFF8Font = (BIFF8Font)target;

            if (bIFF8Font.m_fontName.Equals(this.m_fontName))
            {
                for (int i = 0; i < this.m_data.Length; i++)
                {
                    if (this.m_data[i] != bIFF8Font.m_data[i])
                    {
                        return(false);
                    }
                }
                return(true);
            }
            return(false);
        }