]> git.lyx.org Git - lyx.git/commitdiff
Fix booktabs bottom line with multirows
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 1 Apr 2019 03:43:32 +0000 (05:43 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 1 Apr 2019 16:45:57 +0000 (18:45 +0200)
Fixes: #11445
(cherry picked from commit 819c9c164579bb11322238258ca71f5aa2621705)

src/insets/InsetTabular.cpp
status.23x

index 0e1c8499c89c15f8d90ef5bb075ffe0d48056430..f9a78e1d6b9de4d844b0033d2c64c90d9076b242 100644 (file)
@@ -4009,6 +4009,8 @@ void InsetTabular::drawCellLines(PainterInfo & pi, int x, int y,
        int const w = tabular.cellWidth(cell);
        int const h = tabular.cellHeight(cell);
 
        int const w = tabular.cellWidth(cell);
        int const h = tabular.cellHeight(cell);
 
+       col_type const col = tabular.cellColumn(cell);
+
        // Top
        bool drawline = tabular.topLine(cell)
                || (row > 0 && tabular.bottomLine(tabular.cellAbove(cell)));
        // Top
        bool drawline = tabular.topLine(cell)
                || (row > 0 && tabular.bottomLine(tabular.cellAbove(cell)));
@@ -4017,12 +4019,18 @@ void InsetTabular::drawCellLines(PainterInfo & pi, int x, int y,
 
        // Bottom
        drawline = tabular.bottomLine(cell);
 
        // Bottom
        drawline = tabular.bottomLine(cell);
-       heavy = tabular.use_booktabs && row == tabular.nrows() - 1
-               && tabular.rowBottomLine(row);
+       row_type const lastrow = tabular.nrows() - 1;
+       // Consider multi-rows
+       row_type r = row;
+       while (r < lastrow && tabular.isMultiRow(tabular.cellIndex(r, col))
+               && tabular.isPartOfMultiRow(r + 1, col))
+               r++;
+       heavy = tabular.use_booktabs
+               && ((row == lastrow && tabular.rowBottomLine(row))
+                   || (r == lastrow && tabular.rowBottomLine(r)));
        tabline(pi, x, y + h, x + w, y + h, drawline, heavy);
 
        // Left
        tabline(pi, x, y + h, x + w, y + h, drawline, heavy);
 
        // Left
-       col_type const col = tabular.cellColumn(cell);
        drawline = tabular.leftLine(cell)
                || (col > 0 && tabular.rightLine(tabular.cellIndex(row, col - 1)));
        tabline(pi, x, y, x, y + h, drawline);
        drawline = tabular.leftLine(cell)
                || (col > 0 && tabular.rightLine(tabular.cellIndex(row, col - 1)));
        tabline(pi, x, y, x, y + h, drawline);
index bfd25c10360066145c4547c0065888ea07bb1ca9..edfeea5175117969d89d63a90512db45a4602500 100644 (file)
@@ -176,6 +176,8 @@ What's new
 
 - Place the indentation bars correctly in full-screen mode (bug 11286).
 
 
 - Place the indentation bars correctly in full-screen mode (bug 11286).
 
+- Fix display of formal table bottom line with multirows (bug 11445).
+
 
 * INTERNALS
 
 
 * INTERNALS