On Wed, Feb 5, 2014 at 5:07 AM, Andrew Parsloe <apars...@clear.net.nz> wrote: > > > On 5/02/2014 9:04 p.m., Scott Kostyshak wrote: >> >> On Wed, Feb 5, 2014 at 2:47 AM, Andrew Parsloe <apars...@clear.net.nz> >> wrote: >>> >>> I notice if I create a table and select the columns of a row (the header >>> row >>> is simplest) then right click > More > Multicolumn, LyX shows a single >>> cell >>> spanning the table, with vertical rules at either end, as one would >>> expect. >>> However, the right rule is not present in the pdf. For a 3-column table, >>> the >>> View Source window shows >>> >>> \multicolumn{3}{|c}{}\tabularnewline >>> >>> whereas it should be >>> >>> \multicolumn{3}{|c|}{}\tabularnewline >>> >>> This is present in both 2.1.0beta2 and 2.0.6 on Windows and is a problem >>> only when *all* cells in the row are selected and converted to a single >>> multicolumn cell. >>> >>> Andrew >>> >>> --- >>> This email is free from viruses and malware because avast! Antivirus >>> protection is active. >>> http://www.avast.com >>> >> >> Hi Andrew, >> >> I remember looking at this code a while ago and it's tricky to get the >> borders right. I forget why. I think it has to do with LyX storing >> left and right borders for each cell but really the LaTeX code should >> show if either is set (because it's the combination). That doesn't >> sound exactly right but it's something like that. >> >> I did some searching and I wonder if this is a duplicate of >> http://www.lyx.org/trac/ticket/8082 . Can you take a look? If not a >> duplicate, can you open a new bug report (and set component to >> tabular) ? >> >> Thanks, >> >> Scott >> > > I should have checked that first. It is probably the same bug, only 8082 > emphasizes the multirow aspect. I've added a comment that the bug arises > also with only multicolumn.
Vincent fixed the painting bug (that LyX output was different from LaTeX output). I wonder if there is another bug here though. If you select all columns of a row in a table and set multicolumn, the right border is unset, even if the right border of the last cell was set before. It seems that if the right border of the last cell was set then the right border of the multicolumn should be set to that. This is what happens with a multirow (the bottom line is set). The attached patch "fixes" the above behavior. I put "fixes" in quotes because it seems like it was on purpose: there is an explicit condition on col > 0 (0 means 1 column). This condition was introduced by Edwin in 62b0691b. Jürgen might have an idea because he changed the code in the condition at 25117149. Jürgen -- do you know why the condition is there? Scott
From d0de8e8d01086c00fb370c4eebe1d2a1225437b6 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak <skost...@lyx.org> Date: Wed, 5 Feb 2014 19:09:18 -0500 Subject: [PATCH] Right border of multicol should be set if 1 col --- src/insets/InsetTabular.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 10e021c..932b994 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1682,8 +1682,7 @@ Tabular::idx_type Tabular::setMultiColumn(idx_type cell, idx_type number, cs.multicolumn = CELL_BEGIN_OF_MULTICOLUMN; if (column_info[col].alignment != LYX_ALIGN_DECIMAL) cs.alignment = column_info[col].alignment; - if (col > 0) - setRightLine(cell, right_border); + setRightLine(cell, right_border); for (idx_type i = 1; i < number; ++i) { CellData & cs1 = cellInfo(cell + i); -- 1.8.3.2