mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Fix crash when deleting outlined insets while the outline panel is open.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22979 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c65107ab21
commit
cae858efc6
16
src/Text.cpp
16
src/Text.cpp
@ -928,11 +928,15 @@ bool Text::erase(Cursor & cur)
|
||||
// this is the code for a normal delete, not pasting
|
||||
// any paragraphs
|
||||
cur.recordUndo(DELETE_UNDO);
|
||||
if(!par.eraseChar(cur.pos(), cur.buffer().params().trackChanges)) {
|
||||
bool const was_inset = cur.paragraph().isInset(cur.pos());
|
||||
if(!par.eraseChar(cur.pos(), cur.buffer().params().trackChanges))
|
||||
// the character has been logically deleted only => skip it
|
||||
cur.top().forwardPos();
|
||||
}
|
||||
cur.checkBufferStructure();
|
||||
|
||||
if (was_inset)
|
||||
updateLabels(cur.buffer());
|
||||
else
|
||||
cur.checkBufferStructure();
|
||||
needsUpdate = true;
|
||||
} else {
|
||||
if (cur.pit() == cur.lastpit())
|
||||
@ -1043,8 +1047,12 @@ bool Text::backspace(Cursor & cur)
|
||||
// without the dreaded mechanism. (JMarc)
|
||||
setCursorIntern(cur, cur.pit(), cur.pos() - 1,
|
||||
false, cur.boundary());
|
||||
bool const was_inset = cur.paragraph().isInset(cur.pos());
|
||||
cur.paragraph().eraseChar(cur.pos(), cur.buffer().params().trackChanges);
|
||||
cur.checkBufferStructure();
|
||||
if (was_inset)
|
||||
updateLabels(cur.buffer());
|
||||
else
|
||||
cur.checkBufferStructure();
|
||||
}
|
||||
|
||||
if (cur.pos() == cur.lastpos())
|
||||
|
Loading…
Reference in New Issue
Block a user