From 91254472e601d573057bd943aed5de36d6fb9438 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 23 Jul 2018 16:36:19 +0200 Subject: [PATCH] Allow to change multiple columns' width at once Fixes: #11205 --- src/insets/InsetTabular.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 9ff12368f3..f1cf912de5 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -5840,10 +5840,12 @@ void InsetTabular::tabularFeatures(Cursor & cur, case Tabular::SET_PWIDTH: { Length const len(value); - tabular.setColumnPWidth(cur, cur.idx(), len); - if (len.zero() - && tabular.getAlignment(cur.idx(), true) == LYX_ALIGN_BLOCK) - tabularFeatures(cur, Tabular::ALIGN_CENTER, string()); + for (col_type c = sel_col_start; c <= sel_col_end; ++c) { + tabular.setColumnPWidth(cur, tabular.cellIndex(row, c), len); + if (len.zero() + && tabular.getAlignment(tabular.cellIndex(row, c), true) == LYX_ALIGN_BLOCK) + tabularFeatures(cur, Tabular::ALIGN_CENTER, string()); + } break; } @@ -5853,7 +5855,8 @@ void InsetTabular::tabularFeatures(Cursor & cur, case Tabular::TOGGLE_VARWIDTH_COLUMN: { bool const varwidth = value == "on"; - tabular.toggleVarwidth(cur.idx(), varwidth); + for (col_type c = sel_col_start; c <= sel_col_end; ++c) + tabular.toggleVarwidth(tabular.cellIndex(row, c), varwidth); break; } @@ -6213,8 +6216,6 @@ void InsetTabular::tabularFeatures(Cursor & cur, tabular.longtabular_alignment = Tabular::LYX_LONGTABULAR_ALIGN_RIGHT; break; - - case Tabular::SET_ROTATE_CELL: for (row_type r = sel_row_start; r <= sel_row_end; ++r) for (col_type c = sel_col_start; c <= sel_col_end; ++c) -- 2.39.5