From b98a650fa14ff10f14f355ad78413ce5bf414bce Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Wed, 26 Mar 2008 10:34:48 +0000 Subject: [PATCH] don't call cellIndex with invalid columns git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23969 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 2eb80ecb0e..5800432351 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1855,14 +1855,13 @@ int Tabular::TeXCellPreamble(odocstream & os, idx_type cell, bool & ismulticol) LyXAlignment align = getAlignment(cell, !isMultiColumn(cell)); // figure out how to set the lines // we always set double lines to the right of the cell + row_type const r = cellRow(cell); col_type const c = cellColumn(cell); col_type const nextcol = c + columnSpan(cell); - row_type const r = cellRow(cell); - idx_type const prevcell = cellIndex(r, c - 1); - idx_type const nextcell = cellIndex(r, nextcol); bool prevmulticol = ismulticol; - bool prevcellright = c > 0 && rightLine(prevcell); - bool nextcellleft = nextcol < columnCount() && leftLine(nextcell); + bool prevcellright = c > 0 && rightLine(cellIndex(r, c - 1)); + bool nextcellleft = nextcol < columnCount() + && leftLine(cellIndex(r, nextcol)); bool nextcolleft = nextcol < columnCount() && columnLeftLine(nextcol); bool coldouble = columnRightLine(c) && nextcolleft; bool celldouble = rightLine(cell) && nextcellleft;