From 4dfca5230722d4f417b15b8992b8f0c02397d7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 12 Jul 2009 13:43:05 +0000 Subject: [PATCH] * InsetTabular.cpp: fix bug 6057: longtable captions must always be in a first header. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30500 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 842f9cc1d4..aa9ceb85a8 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -2132,7 +2132,7 @@ int Tabular::TeXLongtableHeaderFooter(odocstream & os, int ret = 0; // caption handling - // the caption must be output befrore the headers + // the caption must be output before the headers if (haveLTCaption()) { for (row_type i = 0; i < row_info.size(); ++i) { if (row_info[i].caption) { @@ -2307,7 +2307,13 @@ int Tabular::TeXRow(odocstream & os, row_type i, } ++cell; } - os << "\\tabularnewline"; + if (row_info[i].caption && !endfirsthead.empty && !haveLTFirstHead()) + // if no first header and no empty first header is used, + // the caption needs to be terminated by \endfirsthead + // (bug 6056) + os << "\\endfirsthead"; + else + os << "\\tabularnewline"; if (row_info[i].bottom_space_default) { if (use_booktabs) os << "\\addlinespace";