X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathGrid.cpp;h=16e519c11f42544fbdae3e64b479221c9fb3af9b;hb=c9609fe56a2deb40f001503c2fd707c990a2e0e2;hp=ed77f71f851be12a46fa959b5b0f9c7e81d0defc;hpb=201dcc8ec3da924294ade6aefe801cf3bb3f2dc6;p=lyx.git diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index ed77f71f85..16e519c11f 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -674,7 +674,7 @@ docstring InsetMathGrid::eolString(row_type row, bool fragile, // make sure an upcoming '[' does not break anything if (row + 1 < nrows()) { MathData const & c = cell(index(row + 1, 0)); - if (c.size() && c.front()->getChar() == '[') + if (!c.empty() && c.front()->getChar() == '[') //eol += "[0pt]"; eol += "{}"; } @@ -905,7 +905,7 @@ bool InsetMathGrid::idxDelete(idx_type & idx) // try to delete entire sequence of ncols() empty cells if possible for (idx_type i = idx; i < idx + ncols(); ++i) - if (cell(i).size()) + if (!cell(i).empty()) return false; // move cells if necessary @@ -1142,7 +1142,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) switch (act) { // insert file functions - case LFUN_LINE_DELETE: + case LFUN_LINE_DELETE_FORWARD: cur.recordUndoInset(); //autocorrect_ = false; //macroModeClose(); @@ -1302,7 +1302,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) docstring & special = colinfo_[cur.col()].special_; if (!special.empty()) { docstring::size_type i = special.rfind('|'); - LASSERT(i != docstring::npos, /**/); + LASSERT(i != docstring::npos, break); special.erase(i, 1); } } @@ -1311,7 +1311,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) docstring & special = colinfo_[cur.col()+1].special_; if (!special.empty()) { docstring::size_type i = special.find('|'); - LASSERT(i != docstring::npos, /**/); + LASSERT(i != docstring::npos, break); special.erase(i, 1); } } @@ -1334,7 +1334,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) cap::replaceSelection(cur); docstring topaste; if (cmd.argument().empty() && !theClipboard().isInternal()) - topaste = theClipboard().getAsText(); + topaste = theClipboard().getAsText(Clipboard::PlainTextType); else { idocstringstream is(cmd.argument()); int n = 0; @@ -1343,7 +1343,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) } InsetMathGrid grid(buffer_, 1, 1); if (!topaste.empty()) - if ((topaste.size() == 1 && topaste.at(0) < 0x80) + if ((topaste.size() == 1 && isAscii(topaste)) || !mathed_parse_normal(grid, topaste, parseflg)) { resetGrid(grid); mathed_parse_normal(grid, topaste, parseflg | Parse::VERBATIM); @@ -1356,7 +1356,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) hline_enabled = status.enabled(); if (grid.nargs() == 1) { // single cell/part of cell - cur.recordUndo(); + cur.recordUndoInset(); cur.cell().insert(cur.pos(), grid.cell(0)); cur.pos() += grid.cell(0).size(); if (hline_enabled)