When pasting into mathed, take into account the current mode.

For example, this allows to paste something like $x$ to a textmode
inset and get the expected result. If $x$ is pasted in mathmode,
it is pasted verbatim, such that no compile errors can arise.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26935 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2008-10-18 09:06:27 +00:00
parent 02ebfa000b
commit 6bd593d8b3
2 changed files with 4 additions and 0 deletions

View File

@ -1251,6 +1251,8 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
parseflg |= Parse::VERBATIM;
// fall through
case LFUN_PASTE: {
if (cur.currentMode() == TEXT_MODE)
parseflg |= Parse::TEXTMODE;
cur.message(_("Paste"));
cap::replaceSelection(cur);
docstring topaste;

View File

@ -521,6 +521,8 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
parseflg |= Parse::VERBATIM;
// fall through
case LFUN_PASTE: {
if (cur.currentMode() == TEXT_MODE)
parseflg |= Parse::TEXTMODE;
cur.recordUndoSelection();
cur.message(_("Paste"));
replaceSelection(cur);