From 5e6343c9d15f3e76cec63d260ce1880e48152077 Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Tue, 25 Mar 2008 11:40:16 +0000 Subject: [PATCH] take care of overlooked contingency git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23945 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1f521f6a5b..ad7ca536e2 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1863,9 +1863,10 @@ int Tabular::TeXCellPreamble(odocstream & os, idx_type cell) const Tabular::VAlignment valign = getVAlignment(cell, !isMultiColumn(cell)); LyXAlignment align = getAlignment(cell, !isMultiColumn(cell)); col_type c = cellColumn(cell); - if (isMultiColumn(cell) - || (leftLine(cell) && !columnLeftLine(c)) - || (rightLine(cell) && !columnRightLine(c))) { + bool needmulticol = (leftLine(cell) && !columnLeftLine(c)) + || (rightLine(cell) && !columnRightLine(c)) + || (!rightLine(cell) && c < columnCount() -1 && columnLeftLine(c + 1)); + if (isMultiColumn(cell) || needmulticol) { os << "\\multicolumn{" << columnSpan(cell) << "}{"; if (leftLine(cell)) os << '|'; @@ -1901,7 +1902,8 @@ int Tabular::TeXCellPreamble(odocstream & os, idx_type cell) const } } // end if else !getPWidth } // end if else !cellinfo_of_cell - if (rightLine(cell)) + if (rightLine(cell) || (!rightLine(cell) + && c < columnCount() -1 && columnLeftLine(c + 1))) os << '|'; os << "}{"; } @@ -1953,9 +1955,10 @@ int Tabular::TeXCellPostamble(odocstream & os, idx_type cell) const ret += 2; } col_type c = cellColumn(cell); - if (isMultiColumn(cell) - || (leftLine(cell) && !columnLeftLine(c)) - || (rightLine(cell) && !columnRightLine(c))) { + bool needmulticol = (leftLine(cell) && !columnLeftLine(c)) + || (rightLine(cell) && !columnRightLine(c)) + || (!rightLine(cell) && c < columnCount() -1 && columnLeftLine(c + 1)); + if (isMultiColumn(cell) || needmulticol) { os << '}'; } if (getRotateCell(cell)) { -- 2.39.2