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

            obj.m_data = (byte[])m_data.Clone();
            obj.m_hash = 0;
            return(obj);
        }
示例#3
0
        internal int AddStyle(StyleProperties props)
        {
            BIFF8Style bIFF8Style = new BIFF8Style(props);
            BIFF8Font  font       = new BIFF8Font(props);

            bIFF8Style.Ifnt = AddFont(font);
            bIFF8Style.Ifmt = AddFormat(props.NumberFormat);
            return(AddStyle(bIFF8Style));
        }
示例#4
0
 internal int AddFont(BIFF8Font font)
 {
     if (!m_fontMap.TryGetValue(font, out int value))
     {
         value = m_fonts.Count + 5;
         m_fontMap.Add(font, value);
         m_fonts.Add(font);
     }
     return(value);
 }
 internal RichTextInfo(StyleContainer styleContainer)
 {
     m_styleContainer = styleContainer;
     m_startIndex     = 0;
     m_font           = null;
     m_fontList       = new List <Pair <int, int> >();
     m_stringBuilder  = new StringBuilder();
     m_maxFontIndex   = 0;
     m_firstRun       = true;
 }
        internal StringWrapperBIFF8 CompleteRun()
        {
            if (m_font != null)
            {
                int num = m_styleContainer.AddFont(m_font);
                m_maxFontIndex = Math.Max(m_maxFontIndex, num);
                m_fontList.Add(new Pair <int, int>(m_startIndex, num));
            }
            StringWrapperBIFF8 stringWrapperBIFF = new StringWrapperBIFF8(m_stringBuilder.ToString());

            stringWrapperBIFF.SetRunsList(m_fontList);
            m_fontList      = null;
            m_font          = null;
            m_stringBuilder = null;
            return(stringWrapperBIFF);
        }
示例#7
0
        public override bool Equals(object target)
        {
            BIFF8Font bIFF8Font = (BIFF8Font)target;

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