} // namespace anon
-std::vector<string>
+std::vector<string> const
CutAndPaste::availableSelections(Buffer const & buffer)
{
vector<string> selList;
namespace {
-struct resetOwnerAndChanges {
- void operator()(Paragraph & p) {
+struct resetOwnerAndChanges : public std::unary_function<Paragraph, void> {
+ void operator()(Paragraph & p) const {
p.cleanChanges();
p.setInsetOwner(0);
}
BOOST_ASSERT(0 <= end && end <= endpit->size());
BOOST_ASSERT(startpit != endpit || start <= end);
- ParagraphList paragraphs;
// Clone the paragraphs within the selection.
ParagraphList::iterator postend = boost::next(endpit);
- paragraphs.assign(startpit, postend);
+ ParagraphList paragraphs(startpit, postend);
for_each(paragraphs.begin(), paragraphs.end(), resetOwnerAndChanges());
// Cut out the end of the last paragraph.
// this new max depth level so that subsequent
// paragraphs are aligned correctly to this paragraph
// at level 0.
- if ((int(tmpbuf->params().depth()) + depth_delta) < 0)
+ if (int(tmpbuf->params().depth()) + depth_delta < 0)
depth_delta = 0;
// Set the right depth so that we are not too deep or shallow.
tmpbuf->setInsetOwner(pit->inInset());
for (pos_type i = 0; i < tmpbuf->size(); ++i) {
if (tmpbuf->getChar(i) == Paragraph::META_INSET) {
- if (!pit->insetAllowed(tmpbuf->getInset(i)->lyxCode())) {
+ if (!pit->insetAllowed(tmpbuf->getInset(i)->lyxCode()))
tmpbuf->erase(i--);
- }
- } else {
- LyXFont f1 = tmpbuf->getFont(buffer.params(), i, outerFont(pit, pars));
- LyXFont f2 = f1;
- if (!pit->checkInsertChar(f1)) {
- tmpbuf->erase(i--);
- } else if (f1 != f2) {
- tmpbuf->setFont(i, f1);
- }
}
}
}