#include "frontends/LyXView.h"
#include <boost/assert.hpp>
+#include <boost/bind.hpp>
#include <boost/current_function.hpp>
#include <sstream>
namespace {
- bool positionable
- (DocIterator const & cursor, DocIterator const & anchor)
+ bool
+ positionable(DocIterator const & cursor, DocIterator const & anchor)
{
// avoid deeper nested insets when selecting
if (cursor.size() > anchor.size())
idx() = lastidx();
}
if (par() > lastpar()) {
- lyxerr << "wrong par " << par() << ", max is " << lastpar()
+ lyxerr << "wrong par " << par() << ", max is " << lastpar()
<< ". Trying to correct this." << endl;
par() = lastpar();
}
if (pos() > lastpos()) {
- lyxerr << "wrong pos " << pos() << ", max is " << lastpos()
+ lyxerr << "wrong pos " << pos() << ", max is " << lastpos()
<< ". Trying to correct this." << endl;
pos() = lastpos();
}
void LCursor::insert(string const & str)
{
- //lyxerr << "LCursor::insert str '" << str << "'" << endl;
- for (string::const_iterator it = str.begin(); it != str.end(); ++it)
- insert(*it);
+ for_each(str.begin(), str.end(),
+ boost::bind(static_cast<void(LCursor::*)(char)>
+ (&LCursor::insert), this, _1));
}