#include "paragraph.h"
#include "cursor.h"
#include "debug.h"
+#include "undo.h"
#include "frontends/LyXView.h"
}
-void outline(OutlineOp mode, Buffer * buf, pit_type & pit)
+void outline(OutlineOp mode, LCursor & cur)
{
+ recordUndo(cur);
+ Buffer * buf = & cur.buffer();
+ pit_type & pit = cur.pit();
ParagraphList & pars = buf->text().paragraphs();
ParagraphList::iterator bgn = pars.begin();
ParagraphList::iterator s = boost::next(bgn, pit);
int const thistoclevel = s->layout()->toclevel;
int toclevel;
switch (mode) {
- case UP: {
+ case Up: {
if (p != end)
++p;
for (; p != end; ++p) {
pars.erase(s, t);
break;
}
- case DOWN: {
+ case Down: {
if (p != end)
++p;
for (; p != end; ++p) {
pars.erase(s, t);
break;
}
- case IN:
+ case In:
for (; lit != lend; ++lit) {
- if ((*lit)->toclevel == thistoclevel + 1) {
+ if ((*lit)->toclevel == thistoclevel + 1 &&
+ s->layout()->labeltype == (*lit)->labeltype) {
s->layout((*lit));
break;
}
}
break;
- case OUT:
+ case Out:
for (; lit != lend; ++lit) {
- if ((*lit)->toclevel == thistoclevel - 1) {
+ if ((*lit)->toclevel == thistoclevel - 1 &&
+ s->layout()->labeltype == (*lit)->labeltype) {
s->layout((*lit));
break;
}