]> git.lyx.org Git - features.git/commitdiff
Fix bug #8992 without reintroducing #8933
authorGeorg Baum <baum@lyx.org>
Sun, 23 Feb 2014 09:55:23 +0000 (10:55 +0100)
committerGeorg Baum <baum@lyx.org>
Sun, 23 Feb 2014 09:55:23 +0000 (10:55 +0100)
At efa0f198 I introduced a more flexible caption handling for long tables.
This was needed to fix tex2lyx bug #7412. Unfortunately this created bug #8933,
since I forgot to output captions to LaTeX which are not in any header or
footer. This was fixed at 2b941da7f, but this introduced bug #8992 (duplicate
caption output).
This commit is hopefully the final fix: Captions which are in header or footer
lines are output with the header or footer line, and captions in standard
lines are output standalone.

src/insets/InsetTabular.cpp

index 51f579ea3938b0061a4b2db0bc444d318417d8fa..c7f77fa816f2421e693d41eac90a6cc791f5aaae 100644 (file)
@@ -2451,10 +2451,12 @@ void Tabular::TeXLongtableHeaderFooter(otexstream & os,
                return;
 
        // caption handling
-       // the caption must be output before the headers
+       // output caption which is in no header or footer
        if (haveLTCaption()) {
                for (row_type r = 0; r < nrows(); ++r) {
-                       if (row_info[r].caption)
+                       if (row_info[r].caption &&
+                           !row_info[r].endfirsthead && !row_info[r].endhead &&
+                           !row_info[r].endfoot && !row_info[r].endlastfoot)
                                TeXRow(os, r, runparams);
                }
        }