]> git.lyx.org Git - lyx.git/commitdiff
moveColumn now also swaps column_info
authorScott Kostyshak <skostysh@lyx.org>
Tue, 18 Feb 2014 18:39:45 +0000 (13:39 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Fri, 21 Feb 2014 14:40:16 +0000 (09:40 -0500)
For example, width and alignment are now swapped.

Same for moveRow.

src/insets/InsetTabular.cpp

index e52b7621902ebca23637b40284d3c3014158389b..51f579ea3938b0061a4b2db0bc444d318417d8fa 100644 (file)
@@ -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);