}
-
-//////////////////////////////////////////////////////////////
-
-
-InsetMathGrid::CellInfo::CellInfo()
- : multi(CELL_NORMAL)
-{}
-
-
-
//////////////////////////////////////////////////////////////
-InsetMathGrid::RowInfo::RowInfo()
- : descent(0), ascent(0), lines(0), skip(0),
- allow_newpage(true)
-{}
-
-
-
int InsetMathGrid::RowInfo::skipPixels(MetricsInfo const & mi) const
{
return mi.base.inPixels(crskip);
}
-
-//////////////////////////////////////////////////////////////
-
-
-InsetMathGrid::ColInfo::ColInfo()
- : align('c'), width(0), offset(0), lines(0), skip(0)
-{}
-
-
//////////////////////////////////////////////////////////////
}
-InsetMath::idx_type InsetMathGrid::index(row_type row, col_type col) const
+idx_type InsetMathGrid::index(row_type row, col_type col) const
{
return col + ncols() * row;
}
}
-InsetMathGrid::col_type InsetMathGrid::guessColumns(docstring const & hh)
+col_type InsetMathGrid::guessColumns(docstring const & hh)
{
col_type col = 0;
for (char_type const c : hh)
}
-InsetMathGrid::col_type InsetMathGrid::ncols() const
+col_type InsetMathGrid::ncols() const
{
return colinfo_.size() - 1;
}
-InsetMathGrid::row_type InsetMathGrid::nrows() const
+row_type InsetMathGrid::nrows() const
{
return rowinfo_.size() - 1;
}
-InsetMathGrid::col_type InsetMathGrid::col(idx_type idx) const
+col_type InsetMathGrid::col(idx_type idx) const
{
return idx % ncols();
}
-InsetMathGrid::row_type InsetMathGrid::row(idx_type idx) const
+row_type InsetMathGrid::row(idx_type idx) const
{
return idx / ncols();
}
-InsetMathGrid::col_type InsetMathGrid::ncellcols(idx_type idx) const
+col_type InsetMathGrid::ncellcols(idx_type idx) const
{
col_type cols = 1;
if (cellinfo_[idx].multi == CELL_NORMAL)
colinfo_[ncols()].width = 0;
// compute horizontal offsets
- colinfo_[0].offset = border() + colinfo_[0].lines * vlinesep();;
+ colinfo_[0].offset = border() + colinfo_[0].lines * vlinesep();
for (col_type col = 1; col <= ncols(); ++col) {
colinfo_[col].offset =
colinfo_[col - 1].offset +
}
-void InsetMathGrid::mathmlize(MathStream & ms) const
+void InsetMathGrid::mathmlize(MathMLStream & ms) const
{
bool const havetable = nrows() > 1 || ncols() > 1;
if (havetable)
}
-void InsetMathGrid::write(WriteStream & os) const
+void InsetMathGrid::write(TeXMathStream & os) const
{
write(os, 0, 0, nrows(), ncols());
}
-void InsetMathGrid::write(WriteStream & os,
- row_type beg_row, col_type beg_col,
- row_type end_row, col_type end_col) const
+void InsetMathGrid::write(TeXMathStream & os,
+ row_type beg_row, col_type beg_col,
+ row_type end_row, col_type end_col) const
{
MathEnsurer ensurer(os, false);
docstring eol;
for (col_type col = beg_col; col < end_col; ++col) {
idx_type const idx = index(row, col);
bool const empty_cell = cell(idx).empty();
- if (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL)
+ if (last_eoln && (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL))
last_eoln = false;
if (!empty_cell || cellinfo_[idx].multi != CELL_NORMAL ||
colinfo_[col + 1].lines) {
for (col_type col = beg_col; col < end_col;) {
int nccols = 1;
idx_type const idx = index(row, col);
- TexRow::RowEntry entry = TexRow::mathEntry(id(),idx);
+ TexRow::RowEntry const entry = TexRow::mathEntry(id(),idx);
os.texrow().start(entry);
if (col >= lastcol) {
++col;
idocstringstream is(cmd.argument());
int n = 0;
is >> n;
- topaste = cap::selection(n, buffer().params().documentClassPtr());
+ topaste = cap::selection(n, make_pair(buffer().params().documentClassPtr(),
+ buffer().params().authors()), true);
}
InsetMathGrid grid(buffer_, 1, 1);
if (!topaste.empty())
}
}
// append columns for the left over horizontal cells
- for (InsetMath::col_type c = numcols; c < grid.ncols(); ++c) {
+ for (col_type c = numcols; c < grid.ncols(); ++c) {
addCol(c + startcol);
idx_type i = index(r + startrow, min(c + startcol, ncols() - 1));
cell(i).append(grid.cell(grid.index(r, c)));