예제 #1
0
        /**
         * Gets a copy of the font used in a particular formatting Run.
         *
         * @param index     the index of the formatting run
         * @return  A copy of the  font used or null if no formatting is applied to the specified text Run.
         */
        public IFont GetFontOfFormattingRun(int index)
        {
            if (st.sizeOfRArray() == 0 || index >= st.sizeOfRArray())
            {
                return(null);
            }

            CT_RElt r = st.GetRArray(index);

            if (r.rPr != null)
            {
                XSSFFont fnt = new XSSFFont(ToCTFont(r.rPr));
                fnt.SetThemesTable(GetThemesTable());
                return(fnt);
            }
            return(null);
        }
예제 #2
0
 public IFont GetFontOfFormattingRun(int index)
 {
     if (this.st.sizeOfRArray() == 0)
     {
         return((IFont)null);
     }
     for (int index1 = 0; index1 < this.st.sizeOfRArray(); ++index1)
     {
         CT_RElt rarray = this.st.GetRArray(index1);
         if (index1 == index)
         {
             XSSFFont xssfFont = new XSSFFont(XSSFRichTextString.ToCTFont(rarray.rPr));
             xssfFont.SetThemesTable(this.GetThemesTable());
             return((IFont)xssfFont);
         }
     }
     return((IFont)null);
 }
예제 #3
0
        /**
         * Return a copy of the font in use at a particular index.
         *
         * @param index         The index.
         * @return              A copy of the  font that's currently being applied at that
         *                      index or null if no font is being applied or the
         *                      index is out of range.
         */
        public XSSFFont GetFontAtIndex(int index)
        {
            ThemesTable themes = GetThemesTable();
            int         pos    = 0;

            foreach (CT_RElt r in st.r)
            {
                int length = r.t.Length;
                if (index >= pos && index < pos + length)
                {
                    XSSFFont fnt = new XSSFFont(ToCTFont(r.rPr));
                    fnt.SetThemesTable(themes);
                    return(fnt);
                }

                pos += length;
            }
            return(null);
        }
예제 #4
0
        /**
         * Gets a copy of the font used in a particular formatting Run.
         *
         * @param index     the index of the formatting run
         * @return  A copy of the  font used or null if no formatting is applied to the specified text Run.
         */
        public IFont GetFontOfFormattingRun(int index)
        {
            if (st.sizeOfRArray() == 0)
            {
                return(null);
            }

            for (int i = 0; i < st.sizeOfRArray(); i++)
            {
                CT_RElt r = st.GetRArray(i);
                if (i == index)
                {
                    XSSFFont fnt = new XSSFFont(ToCTFont(r.rPr));
                    fnt.SetThemesTable(GetThemesTable());
                    return(fnt);
                }
            }
            return(null);
        }
예제 #5
0
        public short GetFontAtIndex(int index)
        {
            if (this.st.sizeOfRArray() == 0)
            {
                return(-1);
            }
            int num = 0;

            for (int index1 = 0; index1 < this.st.sizeOfRArray(); ++index1)
            {
                CT_RElt rarray = this.st.GetRArray(index1);
                if (index >= num && index < num + rarray.t.Length)
                {
                    XSSFFont xssfFont = new XSSFFont(XSSFRichTextString.ToCTFont(rarray.rPr));
                    xssfFont.SetThemesTable(this.GetThemesTable());
                    return(xssfFont.Index);
                }
                num += rarray.t.Length;
            }
            return(-1);
        }
예제 #6
0
        /**
         * Return a copy of the font in use at a particular index.
         *
         * @param index         The index.
         * @return              A copy of the  font that's currently being applied at that
         *                      index or null if no font is being applied or the
         *                      index is out of range.
         */
        public XSSFFont GetFontAtIndex(int index)
        {
            if (st.sizeOfRArray() == 0)
            {
                return(null);
            }

            int pos = 0;

            for (int i = 0; i < st.sizeOfRArray(); i++)
            {
                CT_RElt r = st.GetRArray(i);
                if (index >= pos && index < pos + r.t.Length)
                {
                    XSSFFont fnt = new XSSFFont(ToCTFont(r.rPr));
                    fnt.SetThemesTable(GetThemesTable());
                    return(fnt);
                }

                pos += r.t.Length;
            }
            return(null);
        }
예제 #7
0
        /**
         * Return a copy of the font in use at a particular index.
         *
         * @param index         The index.
         * @return              A copy of the  font that's currently being applied at that
         *                      index or null if no font is being applied or the
         *                      index is out of range.
         */
        public short GetFontAtIndex(int index)
        {
            if (st.sizeOfRArray() == 0) return -1;

            int pos = 0;
            for (int i = 0; i < st.sizeOfRArray(); i++)
            {
                CT_RElt r = st.GetRArray(i);
                if (index >= pos && index < pos + r.t.Length)
                {
                    XSSFFont fnt = new XSSFFont(ToCTFont(r.rPr));
                    fnt.SetThemesTable(GetThemesTable());
                    return fnt.Index;
                }

                pos += r.t.Length;
            }
            return -1;

        }
예제 #8
0
        /**
         * Gets a copy of the font used in a particular formatting Run.
         *
         * @param index     the index of the formatting run
         * @return  A copy of the  font used or null if no formatting is applied to the specified text Run.
         */
        public IFont GetFontOfFormattingRun(int index)
        {
            if (st.sizeOfRArray() == 0 || index >= st.sizeOfRArray()) return null;

            CT_RElt r = st.GetRArray(index);
            if (r.rPr != null)
            {
                XSSFFont fnt = new XSSFFont(ToCTFont(r.rPr));
                fnt.SetThemesTable(GetThemesTable());
                return fnt;
            }
            return null;
        }
예제 #9
0
        /**
         * Gets a copy of the font used in a particular formatting Run.
         *
         * @param index     the index of the formatting run
         * @return  A copy of the  font used or null if no formatting is applied to the specified text Run.
         */
        public IFont GetFontOfFormattingRun(int index)
        {
            if (st.sizeOfRArray() == 0) return null;

            for (int i = 0; i < st.sizeOfRArray(); i++)
            {
                CT_RElt r = st.GetRArray(i);
                if (i == index)
                {
                    XSSFFont fnt = new XSSFFont(ToCTFont(r.rPr));
                    fnt.SetThemesTable(GetThemesTable());
                    return fnt;
                }
            }
            return null;
        }