]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetTabular.cpp
index 842f9cc1d414eb166985fdd9a93785f149850e5b..05b8f199a2b5ea35824506c77e3db707df27d6e8 100644 (file)
@@ -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 6057)
+               os << "\\endfirsthead";
+       else
+               os << "\\tabularnewline";
        if (row_info[i].bottom_space_default) {
                if (use_booktabs)
                        os << "\\addlinespace";
@@ -3703,8 +3709,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                if (cur.selIsMultiCell()) {
                        cur.recordUndoInset(DELETE_UNDO);
                        cutSelection(cur);
-               }
-               else
+               } else
                        cell(cur.idx())->dispatch(cur, cmd);
                break;
 
@@ -5152,17 +5157,17 @@ void InsetTabular::setChange(Change const & change)
 }
 
 
-void InsetTabular::acceptChanges(BufferParams const & bparams)
+void InsetTabular::acceptChanges()
 {
        for (idx_type idx = 0; idx < nargs(); ++idx)
-               cell(idx)->acceptChanges(bparams);
+               cell(idx)->acceptChanges();
 }
 
 
-void InsetTabular::rejectChanges(BufferParams const & bparams)
+void InsetTabular::rejectChanges()
 {
        for (idx_type idx = 0; idx < nargs(); ++idx)
-               cell(idx)->rejectChanges(bparams);
+               cell(idx)->rejectChanges();
 }