]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.C
more cursor dispatch
[lyx.git] / src / lyxfind.C
index 528ca0b3ccf2a63929176282e6ef41c42d9b583c..b7869ba32725a8a26681cd2bc73816d7d131064d 100644 (file)
@@ -123,7 +123,7 @@ void find(BufferView * bv, FuncRequest const & ev)
        bool forward       = parse_bool(howto);
 
        bool const found = ::find(bv, search,
-                                 forward, casesensitive, matchword);
+                                 casesensitive, matchword, forward);
 
        if (!found)
                bv->owner()->message(_("String not found!"));
@@ -210,7 +210,7 @@ bool findNextChange(BufferView * bv)
 
 namespace {
 
-class MatchString
+class MatchString : public std::binary_function<Paragraph, lyx::pos_type, bool>
 {
 public:
        MatchString(string const & str, bool cs, bool mw)
@@ -281,7 +281,7 @@ bool findBackwards(PosIterator & cur, PosIterator const & beg,
 bool findChange(PosIterator & cur, PosIterator const & end)
 {
        for (; cur != end; ++cur) {
-               if ((!cur.pit()->size() || !cur.at_end())
+               if ((cur.pit()->empty() || !cur.at_end())
                    && cur.pit()->lookupChange(cur.pos()) != Change::UNCHANGED)
                        return true;
        }
@@ -330,7 +330,7 @@ int replaceAll(BufferView * bv,
        if (!searchAllowed(bv, searchstr) || buf.isReadonly())
                return 0;
 
-       recordUndo(Undo::ATOMIC, bv->text(), 0, buf.paragraphs().size() - 1);
+       recordUndoFullDocument(bv->cursor());
 
        PosIterator cur = buf.pos_iterator_begin();
        PosIterator const end = buf.pos_iterator_end();