void InsetMathGrid::copyCol(col_type col)
{
- addCol(col);
+ addCol(col+1);
for (row_type row = 0; row < nrows(); ++row)
cells_[row * ncols() + col + 1] = cells_[row * ncols() + col];
}
lastcol = col + 1;
emptyline = false;
}
- for (col_type col = beg_col; col < last_col; ++col) {
+ for (col_type col = beg_col; col < lastcol; ++col) {
os << cell(index(row, col));
if (os.pendingBrace())
ModeSpecifier specifier(os, TEXT_MODE);
{
//lyxerr << "*** InsetMathGrid: request: " << cmd << endl;
- Parse::flags parseflg = Parse::QUIET;
+ Parse::flags parseflg = Parse::QUIET | Parse::USETEXT;
switch (cmd.action) {
}
InsetMathGrid grid(1, 1);
if (!topaste.empty())
- if (topaste.size() == 1
+ if ((topaste.size() == 1 && topaste.at(0) < 0x80)
|| !mathed_parse_normal(grid, topaste, parseflg)) {
resetGrid(grid);
mathed_parse_normal(grid, topaste,
{
switch (cmd.action) {
case LFUN_TABULAR_FEATURE: {
- string const s = to_utf8(cmd.argument());
+ string const s = cmd.getArg(0);
if (nrows() <= 1 && (s == "delete-row" || s == "swap-row")) {
status.setEnabled(false);
status.message(from_utf8(N_("Only one row")));
}
if (s == "valign-top" || s == "valign-middle" ||
s == "valign-bottom" || s == "align-left" ||
- s == "align-right" || s == "align-center" ||
- s == "append-row" || s == "delete-row" ||
+ s == "align-right" || s == "align-center") {
+ status.setEnabled(true);
+ char const ha = horizontalAlignment(cur.col());
+ char const va = verticalAlignment();
+ status.setOnOff((s == "align-left" && ha == 'l')
+ || (s == "align-right" && ha == 'r')
+ || (s == "align-center" && ha == 'c')
+ || (s == "valign-top" && va == 't')
+ || (s == "valign-bottom" && va == 'b')
+ || (s == "valign-middle" && va == 'm'));
+ }
+ if (s == "append-row" || s == "delete-row" ||
s == "copy-row" || s == "swap-row" ||
s == "add-hline-above" || s == "add-hline-below" ||
s == "delete-hline-above" || s == "delete-hline-below" ||
from_utf8(N_("Unknown tabular feature '%1$s'")), lyx::from_ascii(s)));
}
- char const ha = horizontalAlignment(cur.col());
- char const va = verticalAlignment();
- status.setOnOff((s == "align-left" && ha == 'l')
- || (s == "align-right" && ha == 'r')
- || (s == "align-center" && ha == 'c')
- || (s == "valign-top" && va == 't')
- || (s == "valign-bottom" && va == 'b')
- || (s == "valign-middle" && va == 'm'));
-
#if 0
// FIXME: What did this code do?
// Please check whether it is still needed!