/** * Imports the rows and settings from the Table into this * RtfTable. * * @param table The source Table */ private void ImportTable(Legacy.Text.Table table) { this.rows = new ArrayList(); this.tableWidthPercent = table.Width; this.proportionalWidths = table.ProportionalWidths; this.cellPadding = (float)(table.Cellpadding * TWIPS_FACTOR); this.cellSpacing = (float)(table.Cellspacing * TWIPS_FACTOR); this.borders = new RtfBorderGroup(this.document, RtfBorder.ROW_BORDER, table.Border, table.BorderWidth, table.BorderColor); this.alignment = table.Alignment; int i = 0; foreach (Row row in table) { this.rows.Add(new RtfRow(this.document, this, row, i)); i++; } for (i = 0; i < this.rows.Count; i++) { ((RtfRow)this.rows[i]).HandleCellSpanning(); ((RtfRow)this.rows[i]).CleanRow(); } this.headerRows = table.LastHeaderRow; this.cellsFitToPage = table.CellsFitPage; this.tableFitToPage = table.TableFitsPage; if (!float.IsNaN(table.Offset)) { this.offset = (int)(table.Offset * 2); } }
/** * Constructs a RtfTable based on a Table for a RtfDocument. * * @param doc The RtfDocument this RtfTable belongs to * @param table The Table that this RtfTable wraps */ public RtfTable(RtfDocument doc, Legacy.Text.Table table) : base(doc) { table.Complete(); ImportTable(table); }