#include "Counters.h"
#include "Cursor.h"
#include "CutAndPaste.h"
-#include "support/debug.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "support/gettext.h"
#include "Language.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "TextClass.h"
#include "TextMetrics.h"
-#include "support/convert.h"
-#include "support/docstream.h"
-#include "support/FileName.h"
-#include "support/lstrings.h"
-
#include "frontends/alert.h"
#include "frontends/Clipboard.h"
#include "frontends/Painter.h"
#include "frontends/Selection.h"
+
+#include "support/convert.h"
+#include "support/debug.h"
+#include "support/docstream.h"
+#include "support/FileName.h"
+#include "support/gettext.h"
+#include "support/lstrings.h"
+
#include <boost/scoped_ptr.hpp>
#include <sstream>
{
ret.erase();
size_t token_length = strlen(token);
- string::size_type pos = str.find(token);
+ size_t pos = str.find(token);
if (pos == string::npos || pos + token_length + 1 >= str.length()
|| str[pos + token_length] != '=')
/////////////////////////////////////////////////////////////////////
-Tabular::cellstruct::cellstruct(BufferParams const & bp)
+Tabular::CellData::CellData(Buffer const & buffer)
: cellno(0),
width(0),
multicolumn(Tabular::CELL_NORMAL),
right_line(false),
usebox(BOX_NONE),
rotate(false),
- inset(new InsetText(bp))
+ inset(new InsetText(buffer.params()))
{
- inset->paragraphs().back().layout(bp.getTextClass().emptyLayout());
+ inset->setBuffer(const_cast<Buffer &>(buffer));
+ inset->paragraphs().back().setLayout(buffer.params().documentClass().emptyLayout());
}
-Tabular::cellstruct::cellstruct(cellstruct const & cs)
+Tabular::CellData::CellData(CellData const & cs)
: cellno(cs.cellno),
width(cs.width),
multicolumn(cs.multicolumn),
{}
-Tabular::cellstruct & Tabular::cellstruct::operator=(cellstruct cs)
+Tabular::CellData & Tabular::CellData::operator=(CellData cs)
{
swap(cs);
return *this;
}
-void Tabular::cellstruct::swap(cellstruct & rhs)
+void Tabular::CellData::swap(CellData & rhs)
{
std::swap(cellno, rhs.cellno);
std::swap(width, rhs.width);
}
-Tabular::rowstruct::rowstruct()
+Tabular::RowData::RowData()
: ascent(0),
descent(0),
top_line(true),
{}
-Tabular::columnstruct::columnstruct()
+Tabular::ColumnData::ColumnData()
: alignment(LYX_ALIGN_CENTER),
valignment(LYX_VALIGN_TOP),
left_line(true),
}
-Tabular::Tabular(BufferParams const & bp, row_type rows_arg,
- col_type columns_arg)
+Tabular::Tabular(Buffer const & buffer, row_type rows_arg, col_type columns_arg)
{
- init(bp, rows_arg, columns_arg);
+ init(buffer, rows_arg, columns_arg);
}
// activates all lines and sets all widths to 0
-void Tabular::init(BufferParams const & bp, row_type rows_arg,
+void Tabular::init(Buffer const & buf, row_type rows_arg,
col_type columns_arg)
{
+ buffer_ = &buf;
row_info = row_vector(rows_arg);
column_info = column_vector(columns_arg);
- cell_info = cell_vvector(rows_arg, cell_vector(columns_arg, cellstruct(bp)));
+ cell_info = cell_vvector(rows_arg, cell_vector(columns_arg, CellData(buf)));
row_info.reserve(10);
column_info.reserve(10);
cell_info.reserve(100);
}
-void Tabular::appendRow(BufferParams const & bp, idx_type const cell)
+void Tabular::appendRow(idx_type const cell)
{
+ BufferParams const & bp = buffer().params();
row_type const row = cellRow(cell);
row_vector::iterator rit = row_info.begin() + row;
- row_info.insert(rit, rowstruct());
+ row_info.insert(rit, RowData());
// now set the values of the row before
row_info[row] = row_info[row + 1];
for (row_type i = 0; i < nrows - 1; ++i)
swap(cell_info[i], old[i]);
- cell_info = cell_vvector(nrows, cell_vector(ncols, cellstruct(bp)));
+ cell_info = cell_vvector(nrows, cell_vector(ncols, CellData(buffer())));
for (row_type i = 0; i <= row; ++i)
swap(cell_info[i], old[i]);
}
-void Tabular::copyRow(BufferParams const & bp, row_type const row)
+void Tabular::copyRow(row_type const row)
{
row_info.insert(row_info.begin() + row, row_info[row]);
cell_info.insert(cell_info.begin() + row, cell_info[row]);
- if (bp.trackChanges)
+ if (buffer().params().trackChanges)
for (col_type j = 0; j < columnCount(); ++j)
cell_info[row + 1][j].inset->setChange(Change(Change::INSERTED));
}
-void Tabular::appendColumn(BufferParams const & bp, idx_type const cell)
+void Tabular::appendColumn(idx_type const cell)
{
col_type const column = cellColumn(cell);
col_type const ncols = columnCount();
column_vector::iterator cit = column_info.begin() + column + 1;
- column_info.insert(cit, columnstruct());
+ column_info.insert(cit, ColumnData());
// set the column values of the column before
column_info[column + 1] = column_info[column];
+ BufferParams const & bp = buffer().params();
for (row_type i = 0; i < rowCount(); ++i) {
- cell_info[i].insert(cell_info[i].begin() + column + 1, cellstruct(bp));
+ cell_info[i].insert(cell_info[i].begin() + column + 1, CellData(buffer()));
// care about multicolumns
if (cell_info[i][column + 1].multicolumn == CELL_BEGIN_OF_MULTICOLUMN)
}
-void Tabular::copyColumn(BufferParams const & bp, col_type const column)
+void Tabular::copyColumn(col_type const column)
{
+ BufferParams const & bp = buffer().params();
column_info.insert(column_info.begin() + column, column_info[column]);
for (row_type i = 0; i < rowCount(); ++i)
cur.push(*inset);
// undo information has already been recorded
inset->getText(0)->setLayout(cur.bv().buffer(), 0, cur.lastpit() + 1,
- bp.getTextClass().emptyLayoutName());
+ bp.documentClass().emptyLayoutName());
cur.pop();
}
}
-void Tabular::write(Buffer const & buf, ostream & os) const
+void Tabular::write(ostream & os) const
{
// header line
os << "<lyxtabular"
<< write_attribute("special", cell_info[i][j].align_special)
<< ">\n";
os << "\\begin_inset ";
- cell_info[i][j].inset->write(buf, os);
+ cell_info[i][j].inset->write(os);
os << "\n\\end_inset\n"
<< "</cell>\n";
}
}
-void Tabular::read(Buffer const & buf, Lexer & lex)
+void Tabular::read(Lexer & lex)
{
string line;
istream & is = lex.getStream();
l_getline(is, line);
- if (!prefixIs(line, "<lyxtabular ")
- && !prefixIs(line, "<Tabular ")) {
+ if (!prefixIs(line, "<lyxtabular ") && !prefixIs(line, "<Tabular ")) {
BOOST_ASSERT(false);
return;
}
int columns_arg;
if (!getTokenValue(line, "columns", columns_arg))
return;
- init(buf.params(), rows_arg, columns_arg);
+ init(buffer(), rows_arg, columns_arg);
l_getline(is, line);
if (!prefixIs(line, "<features")) {
lyxerr << "Wrong tabular format (expected <features ...> got"
getTokenValue(line, "special", cell_info[i][j].align_special);
l_getline(is, line);
if (prefixIs(line, "\\begin_inset")) {
- cell_info[i][j].inset->read(buf, lex);
+ cell_info[i][j].inset->read(lex);
l_getline(is, line);
}
if (!prefixIs(line, "</cell>")) {
}
-Tabular::cellstruct & Tabular::cellinfo_of_cell(idx_type cell) const
+Tabular::CellData & Tabular::cellinfo_of_cell(idx_type cell) const
{
return cell_info[cellRow(cell)][cellColumn(cell)];
}
-void Tabular::setMultiColumn(Buffer * buffer, idx_type cell,
- idx_type number)
+void Tabular::setMultiColumn(idx_type cell, idx_type number)
{
- cellstruct & cs = cellinfo_of_cell(cell);
+ CellData & cs = cellinfo_of_cell(cell);
cs.multicolumn = CELL_BEGIN_OF_MULTICOLUMN;
cs.alignment = column_info[cellColumn(cell)].alignment;
cs.top_line = row_info[cellRow(cell)].top_line;
cs.left_line = column_info[cellColumn(cell)].left_line;
cs.right_line = column_info[cellColumn(cell+number-1)].right_line;
for (idx_type i = 1; i < number; ++i) {
- cellstruct & cs1 = cellinfo_of_cell(cell + i);
+ CellData & cs1 = cellinfo_of_cell(cell + i);
cs1.multicolumn = CELL_PART_OF_MULTICOLUMN;
- cs.inset->appendParagraphs(buffer, cs1.inset->paragraphs());
+ cs.inset->appendParagraphs(cs1.inset->paragraphs());
cs1.inset->clear();
}
updateIndexes();
++tmp;
}
if (use_booktabs && row == 0) {
- os << "\\toprule ";
+ if (topLine(fcell))
+ os << "\\toprule ";
} else if (tmp == n - fcell) {
os << (use_booktabs ? "\\midrule " : "\\hline ");
} else if (tmp) {
++tmp;
}
if (use_booktabs && row == rowCount() - 1) {
- os << "\\bottomrule";
+ if (bottomLine(fcell))
+ os << "\\bottomrule";
} else if (tmp == n - fcell) {
os << (use_booktabs ? "\\midrule" : "\\hline");
} else if (tmp) {
}
-int Tabular::TeXLongtableHeaderFooter(odocstream & os, Buffer const & buf,
+int Tabular::TeXLongtableHeaderFooter(odocstream & os,
OutputParams const & runparams) const
{
if (!is_long_tabular)
}
for (row_type i = 0; i < rowCount(); ++i) {
if (row_info[i].endhead) {
- ret += TeXRow(os, i, buf, runparams);
+ ret += TeXRow(os, i, runparams);
}
}
if (endhead.bottomDL) {
}
for (row_type i = 0; i < rowCount(); ++i) {
if (row_info[i].endfirsthead) {
- ret += TeXRow(os, i, buf, runparams);
+ ret += TeXRow(os, i, runparams);
}
}
if (endfirsthead.bottomDL) {
}
for (row_type i = 0; i < rowCount(); ++i) {
if (row_info[i].endfoot) {
- ret += TeXRow(os, i, buf, runparams);
+ ret += TeXRow(os, i, runparams);
}
}
if (endfoot.bottomDL) {
}
for (row_type i = 0; i < rowCount(); ++i) {
if (row_info[i].endlastfoot) {
- ret += TeXRow(os, i, buf, runparams);
+ ret += TeXRow(os, i, runparams);
}
}
if (endlastfoot.bottomDL) {
}
-int Tabular::TeXRow(odocstream & os, row_type i, Buffer const & buf,
+int Tabular::TeXRow(odocstream & os, row_type i,
OutputParams const & runparams) const
{
idx_type cell = cellIndex(i, 0);
shared_ptr<InsetText> inset = getCellInset(cell);
Paragraph const & par = inset->paragraphs().front();
- bool rtl = par.isRTL(buf.params())
+ bool rtl = par.isRTL(buffer().params())
&& !par.empty()
&& getPWidth(cell).zero();
if (rtl) {
- if (par.getParLanguage(buf.params())->lang() ==
+ if (par.getParLanguage(buffer().params())->lang() ==
"farsi")
os << "\\textFR{";
- else if (par.getParLanguage(buf.params())->lang() == "arabic_arabi")
+ else if (par.getParLanguage(buffer().params())->lang() == "arabic_arabi")
os << "\\textAR{";
// currently, remaning RTL languages are arabic_arabtex and hebrew
else
os << "\\R{";
}
- ret += inset->latex(buf, os, runparams);
+ ret += inset->latex(os, runparams);
if (rtl)
os << '}';
}
-int Tabular::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+int Tabular::latex(odocstream & os, OutputParams const & runparams) const
{
int ret = 0;
os << "}\n";
++ret;
- ret += TeXLongtableHeaderFooter(os, buf, runparams);
+ ret += TeXLongtableHeaderFooter(os, runparams);
//+---------------------------------------------------------------------
//+ the single row and columns (cells) +
for (row_type i = 0; i < rowCount(); ++i) {
if (isValidRow(i)) {
- ret += TeXRow(os, i, buf, runparams);
+ ret += TeXRow(os, i, runparams);
if (is_long_tabular && row_info[i].newpage) {
os << "\\newpage\n";
++ret;
}
-int Tabular::docbookRow(Buffer const & buf, odocstream & os, row_type row,
+int Tabular::docbookRow(odocstream & os, row_type row,
OutputParams const & runparams) const
{
int ret = 0;
}
os << '>';
- ret += getCellInset(cell)->docbook(buf, os, runparams);
+ ret += getCellInset(cell)->docbook(os, runparams);
os << "</entry>\n";
++cell;
}
}
-int Tabular::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+int Tabular::docbook(odocstream & os, OutputParams const & runparams) const
{
int ret = 0;
++ret;
for (row_type i = 0; i < rowCount(); ++i) {
if (row_info[i].endhead || row_info[i].endfirsthead) {
- ret += docbookRow(buf, os, i, runparams);
+ ret += docbookRow(os, i, runparams);
}
}
os << "</thead>\n";
++ret;
for (row_type i = 0; i < rowCount(); ++i) {
if (row_info[i].endfoot || row_info[i].endlastfoot) {
- ret += docbookRow(buf, os, i, runparams);
+ ret += docbookRow(os, i, runparams);
}
}
os << "</tfoot>\n";
++ret;
for (row_type i = 0; i < rowCount(); ++i) {
if (isValidRow(i)) {
- ret += docbookRow(buf, os, i, runparams);
+ ret += docbookRow(os, i, runparams);
}
}
os << "</tbody>\n";
}
-void Tabular::plaintextPrintCell(Buffer const & buf, odocstream & os,
+void Tabular::plaintextPrintCell(odocstream & os,
OutputParams const & runparams,
idx_type cell, row_type row, col_type column,
vector<unsigned int> const & clen,
bool onlydata) const
{
odocstringstream sstr;
- getCellInset(cell)->plaintext(buf, sstr, runparams);
+ getCellInset(cell)->plaintext(sstr, runparams);
if (onlydata) {
os << sstr.str();
}
-void Tabular::plaintext(Buffer const & buf, odocstream & os,
+void Tabular::plaintext(odocstream & os,
OutputParams const & runparams, int const depth,
bool onlydata, char_type delim) const
{
if (isMultiColumnReal(cell))
continue;
odocstringstream sstr;
- getCellInset(cell)->plaintext(buf, sstr, runparams);
+ getCellInset(cell)->plaintext(sstr, runparams);
if (clen[j] < sstr.str().length())
clen[j] = sstr.str().length();
}
if (!isMultiColumnReal(cell) || isPartOfMultiColumn(i, j))
continue;
odocstringstream sstr;
- getCellInset(cell)->plaintext(buf, sstr, runparams);
+ getCellInset(cell)->plaintext(sstr, runparams);
int len = int(sstr.str().length());
idx_type const n = cells_in_multicolumn(cell);
for (col_type k = j; len > 0 && k < j + n - 1; ++k)
// we don't use operator<< for single UCS4 character.
// see explanation in docstream.h
os.put(delim);
- plaintextPrintCell(buf, os, runparams,
- cell, i, j, clen, onlydata);
+ plaintextPrintCell(os, runparams, cell, i, j, clen, onlydata);
++cell;
}
os << endl;
InsetTabular::InsetTabular(Buffer const & buf, row_type rows,
col_type columns)
- : tabular(buf.params(), max(rows, row_type(1)),
- max(columns, col_type(1))), buffer_(&buf), scx_(0)
-{}
+ : tabular(buf, max(rows, row_type(1)), max(columns, col_type(1))), scx_(0)
+{
+ setBuffer(const_cast<Buffer &>(buf)); // FIXME: remove later
+}
InsetTabular::InsetTabular(InsetTabular const & tab)
- : Inset(tab), tabular(tab.tabular),
- buffer_(tab.buffer_), scx_(0)
-{}
+ : Inset(tab), tabular(tab.tabular), scx_(0)
+{
+ setBuffer(const_cast<Buffer &>(tab.buffer())); // FIXME: remove later
+}
InsetTabular::~InsetTabular()
}
-Buffer const & InsetTabular::buffer() const
-{
- return *buffer_;
-}
-
-
-void InsetTabular::buffer(Buffer const * b)
-{
- buffer_ = b;
-}
-
-
bool InsetTabular::insetAllowed(InsetCode code) const
{
if (code == MATHMACRO_CODE)
}
-void InsetTabular::write(Buffer const & buf, ostream & os) const
+void InsetTabular::write(ostream & os) const
{
os << "Tabular" << endl;
- tabular.write(buf, os);
+ tabular.write(os);
}
-void InsetTabular::read(Buffer const & buf, Lexer & lex)
+void InsetTabular::read(Lexer & lex)
{
bool const old_format = (lex.getString() == "\\LyXTable");
- tabular.read(buf, lex);
+ tabular.read(lex);
if (old_format)
return;
}
-docstring const InsetTabular::editMessage() const
+docstring InsetTabular::editMessage() const
{
return _("Opened table");
}
-void InsetTabular::edit(Cursor & cur, bool, EntryDirection direction)
+void InsetTabular::edit(Cursor & cur, bool front, EntryDirection)
{
//lyxerr << "InsetTabular::edit: " << this << endl;
cur.finishUndo();
cur.selection() = false;
cur.push(*this);
- if (direction == ENTRY_DIRECTION_LEFT) {
+ if (front) {
if (isRightToLeft(cur))
cur.idx() = tabular.getLastCellInRow(0);
else
}
-void InsetTabular::updateLabels(Buffer const & buf, ParIterator const & it)
+void InsetTabular::updateLabels(ParIterator const & it)
{
// In a longtable, tell captions what the current float is
- Counters & cnts = buf.params().getTextClass().counters();
+ Counters & cnts = buffer().params().documentClass().counters();
string const saveflt = cnts.current_float();
if (tabular.isLongTabular())
cnts.current_float("table");
it2.forwardPos();
size_t const end = it2.nargs();
for ( ; it2.idx() < end; it2.top().forwardIdx())
- lyx::updateLabels(buf, it2);
+ lyx::updateLabels(buffer(), it2);
//reset afterwards
if (tabular.isLongTabular())
}
-int InsetTabular::latex(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+int InsetTabular::latex(odocstream & os, OutputParams const & runparams) const
{
- return tabular.latex(buf, os, runparams);
+ return tabular.latex(os, runparams);
}
-int InsetTabular::plaintext(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+int InsetTabular::plaintext(odocstream & os, OutputParams const & runparams) const
{
os << '\n'; // output table on a new line
int const dp = runparams.linelen > 0 ? runparams.depth : 0;
- tabular.plaintext(buf, os, runparams, dp, false, 0);
+ tabular.plaintext(os, runparams, dp, false, 0);
return PLAINTEXT_NEWLINE;
}
-int InsetTabular::docbook(Buffer const & buf, odocstream & os,
- OutputParams const & runparams) const
+int InsetTabular::docbook(odocstream & os, OutputParams const & runparams) const
{
int ret = 0;
Inset * master = 0;
os << "<informaltable>";
++ret;
}
- ret += tabular.docbook(buf, os, runparams);
+ ret += tabular.docbook(os, runparams);
if (!master) {
os << "</informaltable>";
++ret;
void InsetTabular::tabularFeatures(Cursor & cur,
Tabular::Feature feature, string const & value)
{
- BufferView & bv = cur.bv();
col_type sel_col_start;
col_type sel_col_end;
row_type sel_row_start;
case Tabular::APPEND_ROW:
// append the row into the tabular
- tabular.appendRow(bv.buffer().params(), cur.idx());
+ tabular.appendRow(cur.idx());
break;
case Tabular::APPEND_COLUMN:
// append the column into the tabular
- tabular.appendColumn(bv.buffer().params(), cur.idx());
+ tabular.appendColumn(cur.idx());
cur.idx() = tabular.cellIndex(row, column);
break;
break;
case Tabular::COPY_ROW:
- tabular.copyRow(bv.buffer().params(), row);
+ tabular.copyRow(row);
break;
case Tabular::COPY_COLUMN:
- tabular.copyColumn(bv.buffer().params(), column);
+ tabular.copyColumn(column);
cur.idx() = tabular.cellIndex(row, column);
break;
bool lineSet = !tabular.rightLine(cur.idx(), flag);
for (row_type i = sel_row_start; i <= sel_row_end; ++i)
for (col_type j = sel_col_start; j <= sel_col_end; ++j)
- tabular.setRightLine(
- tabular.cellIndex(i,j),
- lineSet,
- flag);
+ tabular.setRightLine(tabular.cellIndex(i,j), lineSet, flag);
break;
}
case Tabular::ALIGN_BLOCK:
for (row_type i = sel_row_start; i <= sel_row_end; ++i)
for (col_type j = sel_col_start; j <= sel_col_end; ++j)
- tabular.setAlignment(
- tabular.cellIndex(i, j),
- setAlign,
- flag);
+ tabular.setAlignment(tabular.cellIndex(i, j), setAlign, flag);
break;
case Tabular::M_VALIGN_TOP:
case Tabular::VALIGN_MIDDLE:
for (row_type i = sel_row_start; i <= sel_row_end; ++i)
for (col_type j = sel_col_start; j <= sel_col_end; ++j)
- tabular.setVAlignment(
- tabular.cellIndex(i, j),
- setVAlign, flag);
+ tabular.setVAlignment(tabular.cellIndex(i, j), setVAlign, flag);
break;
case Tabular::MULTICOLUMN: {
if (tabular.isMultiColumn(cur.idx()))
tabular.unsetMultiColumn(cur.idx());
else
- tabular.setMultiColumn(&bv.buffer(), cur.idx(), 1);
+ tabular.setMultiColumn(cur.idx(), 1);
break;
}
// we have a selection so this means we just add all this
// cells to form a multicolumn cell
idx_type const s_start = cur.selBegin().idx();
idx_type const s_end = cur.selEnd().idx();
- tabular.setMultiColumn(&bv.buffer(), s_start, s_end - s_start + 1);
+ tabular.setMultiColumn(s_start, s_end - s_start + 1);
cur.idx() = s_start;
cur.pit() = 0;
cur.pos() = 0;
case Tabular::UNSET_ROTATE_CELL:
for (row_type i = sel_row_start; i <= sel_row_end; ++i)
for (col_type j = sel_col_start; j <= sel_col_end; ++j)
- tabular.setRotateCell(
- tabular.cellIndex(i, j), false);
+ tabular.setRotateCell(tabular.cellIndex(i, j), false);
break;
case Tabular::TOGGLE_ROTATE_CELL:
odocstringstream os;
OutputParams const runparams(0);
- paste_tabular->plaintext(cur.buffer(), os, runparams, 0, true, '\t');
+ paste_tabular->plaintext(os, runparams, 0, true, '\t');
// Needed for the "Edit->Paste recent" menu and the system clipboard.
cap::copySelection(cur, os.str());
if (buf.length() <= 0)
return true;
- Buffer const & buffer = bv.buffer();
-
col_type cols = 1;
row_type rows = 1;
col_type maxCols = 1;
- docstring::size_type const len = buf.length();
- docstring::size_type p = 0;
+ size_t const len = buf.length();
+ size_t p = 0;
while (p < len &&
(p = buf.find_first_of(from_ascii("\t\n"), p)) != docstring::npos) {
col_type ocol = 0;
row_type row = 0;
if (usePaste) {
- paste_tabular.reset(
- new Tabular(buffer.params(), rows, maxCols));
+ paste_tabular.reset(new Tabular(buffer(), rows, maxCols));
loctab = paste_tabular.get();
cols = 0;
dirtyTabularStack(true);
row = tabular.cellRow(cell);
}
- docstring::size_type op = 0;
+ size_t op = 0;
idx_type const cells = loctab->cellCount();
p = 0;
cols = ocol;
if (cols < columns) {
shared_ptr<InsetText> inset = loctab->getCellInset(cell);
Font const font = bv.textMetrics(&inset->text_).
- getDisplayFont(0, 0);
+ displayFont(0, 0);
inset->setText(buf.substr(op, p - op), font,
- buffer.params().trackChanges);
+ buffer().params().trackChanges);
++cols;
++cell;
}
if (cols < columns) {
shared_ptr<InsetText> inset = tabular.getCellInset(cell);
Font const font = bv.textMetrics(&inset->text_).
- getDisplayFont(0, 0);
+ displayFont(0, 0);
inset->setText(buf.substr(op, p - op), font,
- buffer.params().trackChanges);
+ buffer().params().trackChanges);
}
cols = ocol;
++row;
// check for the last cell if there is no trailing '\n'
if (cell < cells && op < len) {
shared_ptr<InsetText> inset = loctab->getCellInset(cell);
- Font const font = bv.textMetrics(&inset->text_).getDisplayFont(0, 0);
+ Font const font = bv.textMetrics(&inset->text_).displayFont(0, 0);
inset->setText(buf.substr(op, len - op), font,
- buffer.params().trackChanges);
+ buffer().params().trackChanges);
}
return true;
}
// by Buffer::readInset
lex >> token;
if (!lex || token != "Tabular")
- return print_mailer_error("InsetTabularMailer", in, 2,
- "Tabular");
+ return print_mailer_error("InsetTabularMailer", in, 2, "Tabular");
- Buffer const & buffer = inset.buffer();
- inset.read(buffer, lex);
+ inset.read(lex);
}
{
ostringstream data;
data << name_ << ' ';
- inset.write(inset.buffer(), data);
+ inset.write(data);
data << "\\end_inset\n";
return data.str();
}