]> git.lyx.org Git - lyx.git/commitdiff
Fix wrong painting of lines right of multicol
authorVincent van Ravesteijn <vfr@lyx.org>
Wed, 5 Feb 2014 20:30:04 +0000 (21:30 +0100)
committerVincent van Ravesteijn <vfr@lyx.org>
Wed, 5 Feb 2014 20:37:57 +0000 (21:37 +0100)
We should skip the other cells that are part of the multicolumn before we find the cell right to the current one.

Fixes-bug: #8082

src/insets/InsetTabular.cpp

index 26df93fbed3f85f5d62cdfaa7c4173e1311ade9c..10e021c4ae671f9c4acfe7cb80c49125d611ad62 100644 (file)
@@ -3846,9 +3846,13 @@ void InsetTabular::drawCellLines(PainterInfo & pi, int x, int y,
 
        // Right
        x -= tabular.interColumnSpace(cell);
+       col_type next_cell_col = col + 1;
+       while (next_cell_col < tabular.ncols() 
+               && tabular.isMultiColumn(tabular.cellIndex(row, next_cell_col)))
+               next_cell_col++;
        drawline = tabular.rightLine(cell)
-                  || (col + 1 < tabular.ncols()
-                      && tabular.leftLine(tabular.cellIndex(row, col + 1)));
+                  || (next_cell_col < tabular.ncols()
+                      && tabular.leftLine(tabular.cellIndex(row, next_cell_col)));
        pi.pain.line(x + w, y, x + w, y + h,
                drawline ? linecolor : gridcolor,
                drawline ? Painter::line_solid : Painter::line_onoffdash);