X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftabular.C;h=25aea3843b06198128f6c6fa1804d36ab1dd4456;hb=70d57a230099e817579520242a73e182bd06b4d9;hp=60c20f9d55c6b5973153283f58d26c10a9912bd6;hpb=864515f3a32c4df83c477281468434a4f0a54a33;p=lyx.git diff --git a/src/tabular.C b/src/tabular.C index 60c20f9d55..25aea3843b 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -516,6 +516,21 @@ void LyXTabular::deleteRow(row_type const row) } +void LyXTabular::copyRow(BufferParams const & bp, row_type const row) +{ + ++rows_; + + row_info.insert(row_info.begin() + row, row_info[row]); + cell_info.insert(cell_info.begin() + row, cell_info[row]); + + if (bp.tracking_changes) + for (col_type j = 0; j < columns_; ++j) + cell_info[row + 1][j].inset->markNew(true); + + set_row_column_number_info(); +} + + void LyXTabular::appendColumn(BufferParams const & bp, idx_type const cell) { ++columns_; @@ -561,6 +576,22 @@ void LyXTabular::deleteColumn(col_type const column) } +void LyXTabular::copyColumn(BufferParams const & bp, col_type const column) +{ + ++columns_; + + column_info.insert(column_info.begin() + column, column_info[column]); + + for (row_type i = 0; i < rows_; ++i) + cell_info[i].insert(cell_info[i].begin() + column, cell_info[i][column]); + + if (bp.tracking_changes) + for (row_type i = 0; i < rows_; ++i) + cell_info[i][column + 1].inset->markNew(true); + fixCellNums(); +} + + void LyXTabular::set_row_column_number_info() { numberofcells = 0;