From 6cbbec8236f476ec1fa557dafc3c04a5b0498020 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sat, 20 Nov 2010 18:59:16 +0000 Subject: [PATCH] InsetTabular.cpp: fix #7055 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36415 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 55ab1e861f..5181e84ca3 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -5093,11 +5093,28 @@ void InsetTabular::tabularFeatures(Cursor & cur, if (len.zero() && tabular.getAlignment(cur.idx(), true) == LYX_ALIGN_BLOCK) tabularFeatures(cur, Tabular::ALIGN_CENTER, string()); + // check if there is a 1-column multicolumn cell + // if so it must get the same width + for (row_type r = 0; r < tabular.nrows(); ++r) { + if (tabular.isMultiColumn(tabular.cellIndex(r, column)) + && tabular.columnSpan(tabular.cellIndex(r, column)) == 1) + tabular.setMColumnPWidth(cur, tabular.cellIndex(r, column), len); + } break; } case Tabular::SET_MPWIDTH: tabular.setMColumnPWidth(cur, cur.idx(), Length(value)); + // if the multicolumn only spans 1 column, the width of the whole column + // must have the same width, see bug #7055 + if (tabular.columnSpan(cur.idx()) == 1) + for (row_type r = 0; r < tabular.nrows(); ++r) { + if (!tabular.isMultiColumn(tabular.cellIndex(r, column))) + tabular.setColumnPWidth(cur, tabular.cellIndex(r, column), Length(value)); + else if (tabular.isMultiColumn(tabular.cellIndex(r, column)) + && tabular.columnSpan(tabular.cellIndex(r, column)) == 1) + tabular.setMColumnPWidth(cur, tabular.cellIndex(r, column), Length(value)); + } break; case Tabular::SET_MROFFSET: -- 2.39.2