]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.C
Fix #1736
[lyx.git] / src / cursor.C
index cbb167104279555c3840528d335f3529ba6f9584..e84d6c27ec312f9b1a4f89de63bf345cf5573b76 100644 (file)
@@ -44,6 +44,7 @@
 #include "frontends/LyXView.h"
 
 #include <boost/assert.hpp>
+#include <boost/bind.hpp>
 #include <boost/current_function.hpp>
 
 #include <sstream>
@@ -61,8 +62,8 @@ using std::swap;
 
 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())
@@ -243,12 +244,12 @@ bool LCursor::getStatus(FuncRequest const & cmd, FuncStatus & status)
                        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();
                }
@@ -624,9 +625,9 @@ void LCursor::plainInsert(MathAtom const & t)
 
 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));
 }