]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.C
Helge's infamous brackets bug
[lyx.git] / src / lyxfind.C
index ad02439bc93a984fa107efc818395d182ea44052..2f16fd3d6ce1dd27ef31f39009a68675d4d4bdf7 100644 (file)
@@ -30,7 +30,7 @@
 #include "frontends/Alert.h"
 #include "frontends/LyXView.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
@@ -88,7 +88,7 @@ public:
                        if (pos > 0 && par.isLetter(pos - 1))
                                return false;
                        if (pos + lyx::pos_type(size) < parsize
-                           && par.isLetter(pos + size));
+                           && par.isLetter(pos + size))
                                return false;
                }
 
@@ -128,7 +128,7 @@ bool findBackwards(DocIterator & cur, MatchString const & match)
 bool findChange(DocIterator & cur)
 {
        for (; cur; cur.forwardChar())
-               if (cur.inTexted() && !cur.paragraph().empty() &&
+               if (cur.inTexted() && cur.pos() != cur.paragraph().size() &&
                    cur.paragraph().lookupChange(cur.pos())
                    != Change::UNCHANGED)
                        return true;
@@ -173,7 +173,7 @@ int replaceAll(BufferView * bv,
        if (!searchAllowed(bv, searchstr) || buf.isReadonly())
                return 0;
 
-       recordUndoFullDocument(bv->cursor());
+       recordUndoFullDocument(bv);
 
        MatchString const match(searchstr, cs, mw);
        int num = 0;
@@ -326,7 +326,7 @@ void replace(BufferView * bv, FuncRequest const & ev)
                if (replace_count == 1) {
                        lv->message(_("String has been replaced."));
                } else {
-                       string str = tostr(replace_count);
+                       string str = convert<string>(replace_count);
                        str += _(" strings have been replaced.");
                        lv->message(str);
                }
@@ -339,7 +339,7 @@ bool findNextChange(BufferView * bv)
        if (!bv->available())
                return false;
 
-       DocIterator cur = DocIterator(bv->cursor());
+       DocIterator cur = bv->cursor();
 
        if (!findChange(cur))
                return false;
@@ -366,8 +366,6 @@ bool findNextChange(BufferView * bv)
        // if we used a lfun like in find/replace, dispatch would do
        // that for us
        bv->update();
-       if (bv->fitCursor())
-               bv->update();
 
        return true;
 }