Exemple #1
0
        /**
         * Sets the character properties of the list numbers.
         *
         * @param level the level number that the properties should apply to.
         * @param chp The character properties.
         */
        public void SetLevelNumberProperties(int level, CharacterProperties chp)
        {
            ListLevel           listLevel  = _listData.GetLevel(level);
            int                 styleIndex = _listData.GetLevelStyle(level);
            CharacterProperties base1      = _styleSheet.GetCharacterStyle(styleIndex);

            byte[] grpprl = CharacterSprmCompressor.CompressCharacterProperty(chp, base1);
            listLevel.SetNumberProperties(grpprl);
        }
Exemple #2
0
        public CharacterRun InsertAfter(String text, CharacterProperties props)
        //
        {
            InitAll();
            PAPX  papx = _paragraphs[_parEnd - 1];
            short istd = papx.GetIstd();

            StyleSheet          ss        = _doc.GetStyleSheet();
            CharacterProperties baseStyle = ss.GetCharacterStyle(istd);

            byte[]     grpprl = CharacterSprmCompressor.CompressCharacterProperty(props, baseStyle);
            SprmBuffer buf    = new SprmBuffer(grpprl);

            _doc.CharacterTable.Insert(_charEnd, _end, buf);
            _charEnd++;
            return(InsertAfter(text));
        }
Exemple #3
0
        protected Paragraph InsertBefore(ParagraphProperties props, int styleIndex, String text)
        //
        {
            InitAll();
            StyleSheet          ss        = _doc.GetStyleSheet();
            ParagraphProperties baseStyle = ss.GetParagraphStyle(styleIndex);
            CharacterProperties baseChp   = ss.GetCharacterStyle(styleIndex);

            byte[] grpprl    = ParagraphSprmCompressor.CompressParagraphProperty(props, baseStyle);
            byte[] withIndex = new byte[grpprl.Length + LittleEndianConsts.SHORT_SIZE];
            LittleEndian.PutShort(withIndex, (short)styleIndex);
            Array.Copy(grpprl, 0, withIndex, LittleEndianConsts.SHORT_SIZE, grpprl.Length);
            SprmBuffer buf = new SprmBuffer(withIndex);

            _doc.ParagraphTable.Insert(_parStart, _start, buf);
            InsertBefore(text, baseChp);
            return(GetParagraph(0));
        }