From c271973b85140ea80e600e6554604deb2e6d7deb Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 24 Mar 2015 10:50:51 +0100 Subject: [PATCH] Fix consecutive merging of tabular cells This is a bug reported and fixed by Edwin Leuven. Here is how Edwin described it in his inimitable minimalist style: first i merge the top-left two cells in a small, say 3x3, table if i then merge this multicolumn cell with the remaining cell in the first row my table ends up all bonkers --- src/insets/InsetTabular.cpp | 3 ++- status.21x | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 3f12358092..2e15a92eaf 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1693,7 +1693,8 @@ Tabular::idx_type Tabular::setMultiColumn(idx_type cell, idx_type number, cs.alignment = column_info[col].alignment; setRightLine(cell, right_border); - for (idx_type i = 1; i < number; ++i) { + idx_type lastcell = cellIndex(row, col + number - 1); + for (idx_type i = 1; i < lastcell - cell + 1; ++i) { CellData & cs1 = cellInfo(cell + i); cs1.multicolumn = CELL_PART_OF_MULTICOLUMN; cs.inset->appendParagraphs(cs1.inset->paragraphs()); diff --git a/status.21x b/status.21x index 30adf9f51e..3edce3946f 100644 --- a/status.21x +++ b/status.21x @@ -135,7 +135,9 @@ What's new - Record undo properly when changing multiple paragraphs parameters (bug 9437). -- Do not offer unsupported macros like \biggg in autocompletion +- Do not offer unsupported macros like \biggg in autocompletion. + +- Fix consecutive merging of tabular cells. * INTERNALS