From 9ca242e5bf1919e510c99f315e3c2506509e2b1d Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Tue, 18 Feb 2014 13:39:45 -0500 Subject: [PATCH] moveColumn now also swaps column_info For example, width and alignment are now swapped. Same for moveRow. --- src/insets/InsetTabular.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index e52b762190..51f579ea39 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -780,6 +780,8 @@ void Tabular::moveColumn(col_type col, ColDirection direction) if (direction == Tabular::LEFT) col = col - 1; + std::swap(column_info[col], column_info[col + 1]); + for (row_type r = 0; r < nrows(); ++r) { std::swap(cell_info[r][col], cell_info[r][col + 1]); std::swap(cell_info[r][col].left_line, cell_info[r][col + 1].left_line); @@ -802,6 +804,8 @@ void Tabular::moveRow(row_type row, RowDirection direction) if (direction == Tabular::UP) row = row - 1; + std::swap(row_info[row], row_info[row + 1]); + for (col_type c = 0; c < ncols(); ++c) { std::swap(cell_info[row][c], cell_info[row + 1][c]); std::swap(cell_info[row][c].top_line, cell_info[row + 1][c].top_line); -- 2.39.2