From 266b87357b4948920353e333e168dd523f97e15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Sat, 20 Nov 2010 04:19:13 +0000 Subject: [PATCH] InsetTabular.cpp: fix #7007 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36401 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index f01bdb5002..e14a688e04 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1027,19 +1027,22 @@ void Tabular::setAlignment(idx_type cell, LyXAlignment align, bool onlycolumn) { col_type const col = cellColumn(cell); + // set alignment for the whole row of the selection is only + // withing one column and it is no multicolumn cell if (onlycolumn || !isMultiColumn(cell)) { - column_info[col].alignment = align; - docstring & dpoint = column_info[col].decimal_point; - if (align == LYX_ALIGN_DECIMAL && dpoint.empty()) - dpoint = from_utf8(lyxrc.default_decimal_point); - } - if (!onlycolumn) { for (row_type r = 0; r < nrows(); ++r) { if (!isMultiRow(cellIndex(r, col))) { cell_info[r][col].alignment = align; cell_info[r][col].inset->setContentAlignment(align); } } + column_info[col].alignment = align; + docstring & dpoint = column_info[col].decimal_point; + if (align == LYX_ALIGN_DECIMAL && dpoint.empty()) + dpoint = from_utf8(lyxrc.default_decimal_point); + } else { + cellInfo(cell).alignment = align; + cellInset(cell).get()->setContentAlignment(align); } }