-/* 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>
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";
}
{
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
}
-LyXTabular::LyXTabular(Buffer const * buf, InsetTabular * inset, LyXLex & lex)
+LyXTabular::LyXTabular(Buffer const & buf, InsetTabular * inset, LyXLex & lex)
{
owner_ = inset;
cur_cell = -1;
}
-void LyXTabular::write(Buffer const * buf, ostream & os) const
+void LyXTabular::write(Buffer const & buf, ostream & os) const
{
// header line
os << "<lyxtabular"
}
-void LyXTabular::read(Buffer const * buf, LyXLex & lex)
+void LyXTabular::read(Buffer const & buf, LyXLex & lex)
{
string line;
istream & is = lex.getStream();
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"
case LYX_VALIGN_TOP:
os << 'p';
break;
- case LYX_VALIGN_CENTER:
+ case LYX_VALIGN_MIDDLE:
os << 'm';
break;
case LYX_VALIGN_BOTTOM:
case LYX_VALIGN_TOP:
os << 't';
break;
- case LYX_VALIGN_CENTER:
+ case LYX_VALIGN_MIDDLE:
os << 'c';
break;
case LYX_VALIGN_BOTTOM:
case LYX_VALIGN_TOP:
os << 't';
break;
- case LYX_VALIGN_CENTER:
+ case LYX_VALIGN_MIDDLE:
os << 'm';
break;
case LYX_VALIGN_BOTTOM:
}
-int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const * buf,
+int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const & buf,
LatexRunParams const & runparams) const
{
if (!is_long_tabular)
}
-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;
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)
}
-int LyXTabular::latex(Buffer const * buf, ostream & os,
+int LyXTabular::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
int ret = 0;
case LYX_VALIGN_TOP:
os << 'p';
break;
- case LYX_VALIGN_CENTER:
+ case LYX_VALIGN_MIDDLE:
os << 'm';
break;
case LYX_VALIGN_BOTTOM:
}
-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) {
if (isPartOfMultiColumn(i, j))
continue;
InsetText & inset = getCellInset(cell);
-
+
ret += inset.linuxdoc(buf, os);
if (isLastCellInRow(cell)) {
}
-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);
case LYX_VALIGN_BOTTOM:
os << "bottom";
break;
- case LYX_VALIGN_CENTER:
+ case LYX_VALIGN_MIDDLE:
os << "middle";
}
os << '"';
}
-int LyXTabular::docbook(Buffer const * buf, ostream & os,
+int LyXTabular::docbook(Buffer const & buf, ostream & os,
bool /*mixcont*/) const
{
int ret = 0;
}
-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
}
-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;