private void EndAndWriteCurrentParagraph(bool forceEmptyParagraph) { if (this._currentParagraph != null) { if (this._document.TableContext.Location == TableContext.State.InCell) { this._document.TableContext.CurrentCell.AddContent(this.GetCurrentParagraph()); } else { this._document.WriteParagraph(this.GetCurrentParagraph()); } this._currentParagraph = null; } else if (forceEmptyParagraph) { if (this._document.TableContext.Location == TableContext.State.InCell) { this._document.TableContext.CurrentCell.AddContent(new OpenXmlParagraphModel.EmptyParagraph()); } else { this._document.WriteEmptyParagraph(); } } }
private OpenXmlParagraphModel GetCurrentParagraph() { if (this._currentParagraph == null) { this._currentParagraph = new OpenXmlParagraphModel(); } return(this._currentParagraph); }
public void WriteListEnd(int level, RPLFormat.ListStyles listStyle, bool endParagraph) { if (listStyle != 0) { OpenXmlParagraphModel currentParagraph = this.GetCurrentParagraph(); currentParagraph.Properties.ListLevel = level - 1; currentParagraph.Properties.ListStyleId = ((listStyle == RPLFormat.ListStyles.Bulleted) ? 1 : this._numberedListId); } if (endParagraph) { this.WriteParagraphEnd(); } }