]> git.lyx.org Git - lyx.git/commitdiff
Due to the increased accuracy of line counting and registering, when a
authorEnrico Forestieri <forenr@lyx.org>
Mon, 14 Feb 2011 01:02:12 +0000 (01:02 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 14 Feb 2011 01:02:12 +0000 (01:02 +0000)
latex error occurs inside a table, the exact faulty table row is spotted.
However, if all cells of a table row are output on the same line, lyx is
not able to tell what cell caused the error and highlights the last cell
of the row. This patch allows to output each cell of a table on its own
line, such that the exact point where the error occurred can be highlighted.
Note that this is only done when exporting for preview, and in normal (nice)
exports everything goes as usual.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37643 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetTabular.cpp

index f38646dfe2a6ceceaed32e158f9de2219ed4c093..b0844be16fc478f5144d8134a046ce816617d702 100644 (file)
@@ -2492,8 +2492,11 @@ void Tabular::TeXRow(otexstream & os, row_type row,
                        head.latex(os, newrp);
                        os << '&';
                        tail.latex(os, newrp);
-               } else if (!isPartOfMultiRow(row, c))
+               } else if (!isPartOfMultiRow(row, c)) {
+                       if (!runparams.nice)
+                               os.texrow().start(par.id(), 0);
                        inset->latex(os, newrp);
+               }
 
                runparams.encoding = newrp.encoding;
                if (rtl)
@@ -2501,7 +2504,10 @@ void Tabular::TeXRow(otexstream & os, row_type row,
 
                TeXCellPostamble(os, cell, ismulticol, ismultirow);
                if (cell != getLastCellInRow(row)) { // not last cell in row
-                       os << " & ";
+                       if (runparams.nice)
+                               os << " & ";
+                       else
+                               os << " &\n";
                }
        }
        if (row_info[row].caption && !endfirsthead.empty && !haveLTFirstHead())