- case OutlineIn:
- buf.undo().recordUndo(cur);
- for (size_t i = 0; i != tc.layoutCount(); ++i) {
- LayoutPtr const & lt = tc.layout(i);
- if (lt->toclevel == thistoclevel + 1 &&
- start->layout()->labeltype == lt->labeltype) {
- start->setLayout(lt);
- break;
+ 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)
+ continue;
+ DocumentClass::const_iterator lit = tc.begin();
+ DocumentClass::const_iterator len = tc.end();
+ for (; lit != len; ++lit) {
+ if (lit->toclevel == toclevel + 1 &&
+ start->layout().labeltype == lit->labeltype) {
+ start->setLayout(*lit);
+ break;
+ }