void WTable::expand(int row, int column, int rowSpan, int columnSpan) { int newNumRows = row + rowSpan; int curNumColumns = columnCount(); int newNumColumns = std::max(curNumColumns, column + columnSpan); if ((newNumRows > rowCount()) || (newNumColumns > curNumColumns)) { if (newNumColumns == curNumColumns && rowCount() >= headerRowCount_) rowsAdded_ += newNumRows - rowCount(); else flags_.set(BIT_GRID_CHANGED); repaint(RepaintInnerHtml); for (int r = rowCount(); r < newNumRows; ++r) rows_.push_back(new WTableRow(this, newNumColumns)); if (newNumColumns > curNumColumns) { for (int r = 0; r < rowCount(); ++r) { WTableRow *tr = rows_[r]; tr->expand(newNumColumns); } for (int c = curNumColumns; c <= column; ++c) columns_.push_back(new WTableColumn(this)); } } //printDebug(); }
void WTable::expand(int row, int column, int rowSpan, int columnSpan) { int newNumRows = row + rowSpan; int curNumColumns = numColumns(); int newNumColumns = std::max(curNumColumns, column + columnSpan); if ((newNumRows > numRows()) || (newNumColumns > curNumColumns)) { gridChanged_ = true; repaint(); for (int row = numRows(); row < newNumRows; ++row) { rows_.push_back(new WTableRow(this, newNumColumns)); } if (newNumColumns > curNumColumns) { for (int row = 0; row < numRows(); ++row) { WTableRow *tr = rows_[row]; tr->expand(newNumColumns); } } } //printDebug(); }