Author: rgheck
Date: Thu Jan 13 21:19:15 2011
New Revision: 37204
URL: http://www.lyx.org/trac/changeset/37204

Log:
These do sometimes get called when we do not know whether it is a
longtable or not, e.g., in the docbook and xhtml output routines.

Modified:
   lyx-devel/trunk/src/insets/InsetTabular.cpp

Modified: lyx-devel/trunk/src/insets/InsetTabular.cpp
==============================================================================
--- lyx-devel/trunk/src/insets/InsetTabular.cpp Thu Jan 13 19:30:24 2011        
(r37203)
+++ lyx-devel/trunk/src/insets/InsetTabular.cpp Thu Jan 13 21:19:15 2011        
(r37204)
@@ -1886,6 +1886,8 @@
 
 bool Tabular::haveLTHead() const
 {
+       if (!is_long_tabular)
+               return false;
        for (row_type i = 0; i < nrows(); ++i)
                if (row_info[i].endhead)
                        return true;
@@ -1895,7 +1897,7 @@
 
 bool Tabular::haveLTFirstHead() const
 {
-       if (endfirsthead.empty)
+       if (!is_long_tabular || endfirsthead.empty)
                return false;
        for (row_type r = 0; r < nrows(); ++r)
                if (row_info[r].endfirsthead)
@@ -1906,6 +1908,8 @@
 
 bool Tabular::haveLTFoot() const
 {
+       if (!is_long_tabular)
+               return false;
        for (row_type r = 0; r < nrows(); ++r)
                if (row_info[r].endfoot)
                        return true;
@@ -1915,7 +1919,7 @@
 
 bool Tabular::haveLTLastFoot() const
 {
-       if (endlastfoot.empty)
+       if (!is_long_tabular || endlastfoot.empty)
                return false;
        for (row_type r = 0; r < nrows(); ++r)
                if (row_info[r].endlastfoot)
@@ -1951,6 +1955,8 @@
 
 bool Tabular::haveLTCaption() const
 {
+       if (!is_long_tabular)
+               return false;
        for (row_type r = 0; r < nrows(); ++r)
                if (row_info[r].caption)
                        return true;

Reply via email to