mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Fixup 9c92494e1a
: avoid crash in Inset::dissolve()
The code path when the inset is empty did not fixup the cursor position correctly. Part of bug #10667.
This commit is contained in:
parent
87ccd23047
commit
8910a8a1cc
10
src/Text.cpp
10
src/Text.cpp
@ -1783,20 +1783,20 @@ bool Text::dissolveInset(Cursor & cur)
|
||||
|
||||
pasteParagraphList(cur, plist, b.params().documentClassPtr(),
|
||||
b.errorList("Paste"));
|
||||
// restore position
|
||||
cur.pit() = min(cur.lastpit(), spit);
|
||||
cur.pos() = min(cur.lastpos(), spos);
|
||||
}
|
||||
|
||||
// delete the inset now
|
||||
inset_it.paragraph().eraseChar(inset_it.pos(), b.params().track_changes);
|
||||
|
||||
cur.forceBufferUpdate();
|
||||
|
||||
// restore position
|
||||
cur.pit() = min(cur.lastpit(), spit);
|
||||
cur.pos() = min(cur.lastpos(), spos);
|
||||
// Ensure the current language is set correctly (bug 6292)
|
||||
cur.text()->setCursor(cur, cur.pit(), cur.pos());
|
||||
cur.clearSelection();
|
||||
cur.resetAnchor();
|
||||
cur.forceBufferUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user