#include "Lexer.h"
#include "LyXRC.h"
#include "Paragraph.h"
-#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
#include "TextClass.h"
#include "TextMetrics.h"
break;
}
- // Do we need to set insets' buffer_ members, because we copied
- // some stuff? We'll assume we do and reset it otherwise.
- bool set_buffers = true;
-
switch (mode) {
case OutlineUp: {
if (start == pars.begin())
pit_type const len = distance(start, finish);
pit_type const deletepit = pit + len;
buf.undo().recordUndo(cur, ATOMIC_UNDO, newpit, deletepit - 1);
- pars.insert(dest, start, finish);
- start = boost::next(pars.begin(), deletepit);
- pit = newpit;
- pars.erase(start, finish);
+ pars.splice(dest, start, finish);
+ cur.pit() = newpit;
break;
}
case OutlineDown: {
}
// One such was found:
pit_type newpit = distance(bgn, dest);
- pit_type const len = distance(start, finish);
buf.undo().recordUndo(cur, ATOMIC_UNDO, pit, newpit - 1);
- pars.insert(dest, start, finish);
- start = boost::next(bgn, pit);
- pit = newpit - len;
- pars.erase(start, finish);
+ pit_type const len = distance(start, finish);
+ pars.splice(dest, start, finish);
+ cur.pit() = newpit - len;
break;
}
case OutlineIn: {
}
}
}
- set_buffers = false;
break;
}
case OutlineOut: {
}
}
}
- set_buffers = false;
break;
}
}
- if (set_buffers)
- // FIXME This only really needs doing for the newly introduced
- // paragraphs. Something like:
- // pit_type const numpars = distance(start, finish);
- // start = boost::next(bgn, pit);
- // finish = boost::next(start, numpars);
- // for (; start != finish; ++start)
- // start->setBuffer(buf);
- // But while this seems to work, it is kind of fragile.
- buf.inset().setBuffer(buf);
}
pit_type const pit = cur.pit();
recUndo(cur, pit, pit + 1);
cur.finishUndo();
- swap(pars_[pit], pars_[pit + 1]);
+ pars_.swap(pit, pit + 1);
cur.buffer()->updateLabels();
needsUpdate = true;
++cur.pit();
pit_type const pit = cur.pit();
recUndo(cur, pit - 1, pit);
cur.finishUndo();
- swap(pars_[pit], pars_[pit - 1]);
+ pars_.swap(pit, pit - 1);
cur.buffer()->updateLabels();
--cur.pit();
needsUpdate = true;
break;
}
- if (lyxrc.spellcheck_continuously && cur.inTexted())
- // Take this opportunity to spellcheck current word.
- cur.paragraph().isMisspelled(cur.pos());
-
needsUpdate |= (cur.pos() != cur.lastpos()) && cur.selection();
// FIXME: The cursor flag is reset two lines below