* Outline(): fix undo/redo for promote/demote

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23379 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-03-02 09:17:10 +00:00
parent 6b10b7fd33
commit 6bf2052227

View File

@ -320,8 +320,9 @@ static void outline(OutlineOp mode, Cursor & cur)
pars.erase(start, finish);
return;
}
case OutlineIn:
buf.undo().recordUndo(cur);
case OutlineIn: {
pit_type const len = distance(start, finish);
buf.undo().recordUndo(cur, ATOMIC_UNDO, pit, pit + len - 1);
for (; start != finish; ++start) {
toclevel = start->layout()->toclevel;
if (toclevel == Layout::NOT_IN_TOC)
@ -336,9 +337,10 @@ static void outline(OutlineOp mode, Cursor & cur)
}
}
return;
case OutlineOut:
buf.undo().recordUndo(cur);
}
case OutlineOut: {
pit_type const len = distance(start, finish);
buf.undo().recordUndo(cur, ATOMIC_UNDO, pit, pit + len - 1);
for (; start != finish; ++start) {
toclevel = start->layout()->toclevel;
if (toclevel == Layout::NOT_IN_TOC)
@ -354,6 +356,7 @@ static void outline(OutlineOp mode, Cursor & cur)
}
return;
}
}
}