From: Juergen Spitzmueller Date: Sun, 29 Dec 2019 13:09:52 +0000 (+0100) Subject: Implement (basic) ct for tabular-feature delete-row and delete-column X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=395b018fc41f6dfd846d6e642454cc1f1bddfdd7;p=features.git Implement (basic) ct for tabular-feature delete-row and delete-column Fixes part of #8469 For a proper fix that works with change-reject as well as with hide changes in output, we need to implement ct information in tabular's row and column. --- diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index d52ba528a3..d225854289 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -745,6 +745,9 @@ void Tabular::deleteRow(row_type const row) return; for (col_type c = 0; c < ncols(); ++c) { + // mark track changes + if (buffer().params().track_changes) + cell_info[row][c].inset->setChange(Change(Change::DELETED)); // Care about multirow cells if (row + 1 < nrows() && cell_info[row][c].multirow == CELL_BEGIN_OF_MULTIROW && @@ -752,8 +755,10 @@ void Tabular::deleteRow(row_type const row) cell_info[row + 1][c].multirow = CELL_BEGIN_OF_MULTIROW; } } - row_info.erase(row_info.begin() + row); - cell_info.erase(cell_info.begin() + row); + if (!buffer().params().track_changes) { + row_info.erase(row_info.begin() + row); + cell_info.erase(cell_info.begin() + row); + } updateIndexes(); } @@ -859,15 +864,20 @@ void Tabular::deleteColumn(col_type const col) return; for (row_type r = 0; r < nrows(); ++r) { + // mark track changes + if (buffer().params().track_changes) + cell_info[r][col].inset->setChange(Change(Change::DELETED)); // Care about multicolumn cells if (col + 1 < ncols() && cell_info[r][col].multicolumn == CELL_BEGIN_OF_MULTICOLUMN && cell_info[r][col + 1].multicolumn == CELL_PART_OF_MULTICOLUMN) { cell_info[r][col + 1].multicolumn = CELL_BEGIN_OF_MULTICOLUMN; } - cell_info[r].erase(cell_info[r].begin() + col); + if (!buffer().params().track_changes) + cell_info[r].erase(cell_info[r].begin() + col); } - column_info.erase(column_info.begin() + col); + if (!buffer().params().track_changes) + column_info.erase(column_info.begin() + col); updateIndexes(); }