]> git.lyx.org Git - lyx.git/commitdiff
Long tables fixed in docbook.
authorJosé Matox <jamatos@lyx.org>
Thu, 21 Feb 2002 15:55:49 +0000 (15:55 +0000)
committerJosé Matox <jamatos@lyx.org>
Thu, 21 Feb 2002 15:55:49 +0000 (15:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3581 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/tabular.C

index c9b5ea0b8cf89855364ad52c9199c1e71e487783..d31da604193edefb3bce08ccaf1c0024261e9de8 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-21  José Matos  <jamatos@fep.up.pt>
+
+       * tabular.C (docBook): fixed support for long tables.
+
 2002-02-20  Juergen Vigna  <jug@sad.it>
 
        * text2.C (getFont): get the drawing font of the Inset if this
index 83a25fb9eb0f04240dff25cdb99175c529193ae8..38cb30447671e15003deedd112e8a7ffa8850b5b 100644 (file)
@@ -2357,48 +2357,44 @@ int LyXTabular::docBook(Buffer const * buf, ostream & os) const
        //+                      Long Tabular case                             +
        //+---------------------------------------------------------------------
 
-#warning Jose please have a look here I changed the longtable header/footer
-#warning ---- options so I had to disable the docbook code (Jug 20011219)
-#if 0
-       if (IsLongTabular()) {
-               // Header
-               if (endhead.row || endfirsthead.row) {
-                       os << "<thead>\n";
-                       if (endfirsthead.row) {
-                               docbookRow(buf, os, endfirsthead.row - 1);
-                       }
-                       if (endhead.row && endhead.row != endfirsthead.row) {
-                               docbookRow(buf, os, endhead.row - 1);
+       // output header info
+       if (haveLTHead() || haveLTFirstHead()) {
+               os << "<thead>\n";
+               ++ret;
+               for (int i = 0; i < rows_; ++i) {
+                       if (row_info[i].endhead || row_info[i].endfirsthead) {
+                               ret += docbookRow(buf, os, i);
                        }
-                       os << "</thead>\n";
                }
-
-               // Footer
-               if (endfoot.row || endlastfoot.row) {
-                       os << "<tfoot>\n";
-                       if (endfoot.row) {
-                               docbookRow(buf, os, endfoot.row - 1);
-                       }
-                       if (endlastfoot.row && endlastfoot.row != endfoot.row) {
-                               docbookRow(buf, os, endlastfoot.row - 1);
+               os << "<thead>\n";
+               ++ret;
+       }
+       // output footer info
+       if (haveLTFoot() || haveLTLastFoot()) {
+               os << "<tfoot>\n";
+               ++ret;
+               for (int i = 0; i < rows_; ++i) {
+                       if (row_info[i].endfoot || row_info[i].endlastfoot) {
+                               ret += docbookRow(buf, os, i);
                        }
-                       os << "</tfoot>\n";
                }
+               os << "</tfoot>\n";
+               ++ret;
        }
-#endif
+
        //+---------------------------------------------------------------------
        //+                      the single row and columns (cells)            +
        //+---------------------------------------------------------------------
 
        os << "<tbody>\n";
+       ++ret;
        for (int i = 0; i < rows_; ++i) {
-               if (!IsLongTabular() || (
-                  !row_info[i].endhead && !row_info[i].endfirsthead &&
-                  !row_info[i].endfoot && !row_info[i].endlastfoot)) {
-                       docbookRow(buf, os, i);
+               if (isValidRow(i)) {
+                       ret += docbookRow(buf, os, i);
                }
        }
        os << "</tbody>\n";
+       ++ret;
        //+---------------------------------------------------------------------
        //+                      the closing of the tabular                    +
        //+---------------------------------------------------------------------