Пример #1
0
        /**
        * Imports the rows and settings from the Table into this
        * RtfTable.
        *
        * @param table The source Table
        */
        private void ImportTable(Table table)
        {
            this.rows = new ArrayList();
            this.tableWidthPercent = table.WidthPercentage;
            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.HasToFitPageCells();
            this.tableFitToPage = table.HasToFitPageTable();
        }