/** * Sets the paragraph properties for a particular level of the list. * * @param level The level number. * @param pap The paragraph properties */ public void SetLevelParagraphProperties(int level, ParagraphProperties pap) { ListLevel listLevel = _listData.GetLevel(level); int styleIndex = _listData.GetLevelStyle(level); ParagraphProperties base1 = _styleSheet.GetParagraphStyle(styleIndex); byte[] grpprl = ParagraphSprmCompressor.CompressParagraphProperty(pap, base1); listLevel.SetLevelProperties(grpprl); }
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)); }