]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.C
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / tabular.C
index 334b2978c69d9389bbafb6143c1214700043410b..10e0b797ae4f84c7e10221b1a97a1c68d1d56022 100644 (file)
@@ -1,13 +1,18 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file tabular.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Lars Gullik Bjønnes
+ * \author Matthias Ettrich
+ * \author José Matos
+ * \author Jean-Marc Lasgouttes
+ * \author Angus Leeming
+ * \author John Levon
+ * \author André Pönitz
+ * \author Jürgen Vigna
  *
- *           Copyright 2000-2002 The LyX Team.
- *
- *           @author: Jürgen Vigna
- *
- * ======================================================
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
@@ -117,8 +122,8 @@ string const tostr(LyXTabular::VAlignment const & num)
        switch (num) {
        case LyXTabular::LYX_VALIGN_TOP:
                return "top";
-       case LyXTabular::LYX_VALIGN_CENTER:
-               return "center";
+       case LyXTabular::LYX_VALIGN_MIDDLE:
+               return "middle";
        case LyXTabular::LYX_VALIGN_BOTTOM:
                return "bottom";
        }
@@ -162,8 +167,8 @@ bool string2type(string const str, LyXTabular::VAlignment & num)
 {
        if (str == "top")
                num = LyXTabular::LYX_VALIGN_TOP;
-       else if (str == "center")
-               num = LyXTabular::LYX_VALIGN_CENTER;
+       else if (str == "middle" )
+               num = LyXTabular::LYX_VALIGN_MIDDLE;
        else if (str == "bottom")
                num = LyXTabular::LYX_VALIGN_BOTTOM;
        else
@@ -365,7 +370,7 @@ LyXTabular::LyXTabular(BufferParams const & bp,
 }
 
 
-LyXTabular::LyXTabular(Buffer const * buf, InsetTabular * inset, LyXLex & lex)
+LyXTabular::LyXTabular(Buffer const & buf, InsetTabular * inset, LyXLex & lex)
 {
        owner_ = inset;
        cur_cell = -1;
@@ -1144,7 +1149,7 @@ int LyXTabular::right_column_of_cell(int cell) const
 }
 
 
-void LyXTabular::write(Buffer const * buf, ostream & os) const
+void LyXTabular::write(Buffer const & buf, ostream & os) const
 {
        // header line
        os << "<lyxtabular"
@@ -1290,7 +1295,7 @@ void LyXTabular::setHeaderFooterRows(int hr, int fhr, int fr, int lfr)
 }
 
 
-void LyXTabular::read(Buffer const * buf, LyXLex & lex)
+void LyXTabular::read(Buffer const & buf, LyXLex & lex)
 {
        string line;
        istream & is = lex.getStream();
@@ -1313,7 +1318,7 @@ void LyXTabular::read(Buffer const * buf, LyXLex & lex)
        int columns_arg;
        if (!getTokenValue(line, "columns", columns_arg))
                return;
-       init(buf->params, rows_arg, columns_arg);
+       init(buf.params, rows_arg, columns_arg);
        l_getline(is, line);
        if (!prefixIs(line, "<features")) {
                lyxerr << "Wrong tabular format (expected <features ...> got"
@@ -1869,7 +1874,7 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
                                case LYX_VALIGN_TOP:
                                        os << 'p';
                                        break;
-                               case LYX_VALIGN_CENTER:
+                               case LYX_VALIGN_MIDDLE:
                                        os << 'm';
                                        break;
                                case LYX_VALIGN_BOTTOM:
@@ -1906,7 +1911,7 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
                case LYX_VALIGN_TOP:
                        os << 't';
                        break;
-               case LYX_VALIGN_CENTER:
+               case LYX_VALIGN_MIDDLE:
                        os << 'c';
                        break;
                case LYX_VALIGN_BOTTOM:
@@ -1920,7 +1925,7 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
                case LYX_VALIGN_TOP:
                        os << 't';
                        break;
-               case LYX_VALIGN_CENTER:
+               case LYX_VALIGN_MIDDLE:
                        os << 'm';
                        break;
                case LYX_VALIGN_BOTTOM:
@@ -1956,7 +1961,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
 }
 
 
-int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
+int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const & buf,
                                         LatexRunParams const & runparams) const
 {
        if (!is_long_tabular)
@@ -2056,7 +2061,7 @@ bool LyXTabular::isValidRow(int const row) const
 }
 
 
-int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
+int LyXTabular::TeXRow(ostream & os, int const i, Buffer const & buf,
                       LatexRunParams const & runparams) const
 {
        int ret = 0;
@@ -2069,7 +2074,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
                ret += TeXCellPreamble(os, cell);
                InsetText & inset = getCellInset(cell);
 
-               bool rtl = inset.paragraphs.begin()->isRightToLeftPar(buf->params) &&
+               bool rtl = inset.paragraphs.begin()->isRightToLeftPar(buf.params) &&
                        !inset.paragraphs.begin()->empty() && getPWidth(cell).zero();
 
                if (rtl)
@@ -2092,7 +2097,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf,
 }
 
 
-int LyXTabular::latex(Buffer const * buf, ostream & os,
+int LyXTabular::latex(Buffer const & buf, ostream & os,
                      LatexRunParams const & runparams) const
 {
        int ret = 0;
@@ -2137,7 +2142,7 @@ int LyXTabular::latex(Buffer const * buf, ostream & os,
                                case LYX_VALIGN_TOP:
                                        os << 'p';
                                        break;
-                               case LYX_VALIGN_CENTER:
+                               case LYX_VALIGN_MIDDLE:
                                        os << 'm';
                                        break;
                                case LYX_VALIGN_BOTTOM:
@@ -2200,7 +2205,7 @@ int LyXTabular::latex(Buffer const * buf, ostream & os,
 }
 
 
-int LyXTabular::linuxdoc(Buffer const * buf, ostream & os) const
+int LyXTabular::linuxdoc(Buffer const & buf, ostream & os) const
 {
        os << "<tabular ca=\"";
        for (int i = 0; i < columns_; ++i) {
@@ -2224,7 +2229,7 @@ int LyXTabular::linuxdoc(Buffer const * buf, ostream & os) const
                        if (isPartOfMultiColumn(i, j))
                                continue;
                        InsetText & inset = getCellInset(cell);
-       
+
                        ret += inset.linuxdoc(buf, os);
 
                        if (isLastCellInRow(cell)) {
@@ -2241,7 +2246,7 @@ int LyXTabular::linuxdoc(Buffer const * buf, ostream & os) const
 }
 
 
-int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const
+int LyXTabular::docbookRow(Buffer const & buf, ostream & os, int row) const
 {
        int ret = 0;
        int cell = getFirstCellInRow(row);
@@ -2272,7 +2277,7 @@ int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const
                case LYX_VALIGN_BOTTOM:
                        os << "bottom";
                        break;
-               case LYX_VALIGN_CENTER:
+               case LYX_VALIGN_MIDDLE:
                        os << "middle";
                }
                os << '"';
@@ -2292,7 +2297,7 @@ int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const
 }
 
 
-int LyXTabular::docbook(Buffer const * buf, ostream & os,
+int LyXTabular::docbook(Buffer const & buf, ostream & os,
                        bool /*mixcont*/) const
 {
        int ret = 0;
@@ -2468,7 +2473,7 @@ int LyXTabular::asciiBottomHLine(ostream & os, int row,
 }
 
 
-int LyXTabular::asciiPrintCell(Buffer const * buf, ostream & os,
+int LyXTabular::asciiPrintCell(Buffer const & buf, ostream & os,
                               int cell, int row, int column,
                               vector<unsigned int> const & clen,
                               bool onlydata) const
@@ -2518,7 +2523,7 @@ int LyXTabular::asciiPrintCell(Buffer const * buf, ostream & os,
 }
 
 
-int LyXTabular::ascii(Buffer const * buf, ostream & os, int const depth,
+int LyXTabular::ascii(Buffer const & buf, ostream & os, int const depth,
                                          bool onlydata, unsigned char delim) const
 {
        int ret = 0;