mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
* src/insets/InsetTabular.cpp:
- sanitize cursor after insertion via LFUN_CLIPBOARD_PASTE or LFUN_FILE_INSERT_PLAINTEXT (bug 4368). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21920 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8005ece7c0
commit
539061ddc8
@ -3412,7 +3412,16 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// FIXME UNICODE
|
||||
docstring const tmpstr = cur.bv().contentsOfPlaintextFile(
|
||||
FileName(to_utf8(cmd.argument())), false);
|
||||
if (!tmpstr.empty() && !insertPlaintextString(cur.bv(), tmpstr, false))
|
||||
if (tmpstr.empty())
|
||||
break;
|
||||
cur.recordUndoInset(INSERT_UNDO);
|
||||
if (insertPlaintextString(cur.bv(), tmpstr, false)) {
|
||||
// content has been replaced,
|
||||
// so cursor might be invalid
|
||||
cur.pos() = cur.lastpos();
|
||||
cur.pit() = cur.lastpit();
|
||||
bvcur.setCursor(cur);
|
||||
} else
|
||||
cur.undispatched();
|
||||
break;
|
||||
}
|
||||
@ -3463,6 +3472,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// content has been replaced,
|
||||
// so cursor might be invalid
|
||||
cur.pos() = cur.lastpos();
|
||||
cur.pit() = cur.lastpit();
|
||||
bvcur.setCursor(cur);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user