]> git.lyx.org Git - features.git/commitdiff
Small clanup (just move functions around)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 6 May 2013 20:50:26 +0000 (22:50 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 6 May 2013 20:50:26 +0000 (22:50 +0200)
src/lyxfind.cpp
src/lyxfind.h

index 9b4ea3f1bbe639c767fbd53fc2ee22f9688654b0..36b663e5e372536b6e8bf7a2d40c40ac6a674836 100644 (file)
@@ -121,23 +121,6 @@ int findBackwards(DocIterator & cur, MatchString const & match,
 }
 
 
-bool findChange(DocIterator & cur, bool next)
-{
-       if (!next)
-               cur.backwardPos();
-       for (; cur; next ? cur.forwardPos() : cur.backwardPos())
-               if (cur.inTexted() && cur.paragraph().isChanged(cur.pos())) {
-                       if (!next)
-                               // if we search backwards, take a step forward
-                               // to correctly set the anchor
-                               cur.forwardPos();
-                       return true;
-               }
-
-       return false;
-}
-
-
 bool searchAllowed(docstring const & str)
 {
        if (str.empty()) {
@@ -404,15 +387,21 @@ bool lyxreplace(BufferView * bv,
 }
 
 
-bool findNextChange(BufferView * bv)
+namespace {
+bool findChange(DocIterator & cur, bool next)
 {
-       return findChange(bv, true);
-}
-
+       if (!next)
+               cur.backwardPos();
+       for (; cur; next ? cur.forwardPos() : cur.backwardPos())
+               if (cur.inTexted() && cur.paragraph().isChanged(cur.pos())) {
+                       if (!next)
+                               // if we search backwards, take a step forward
+                               // to correctly set the anchor
+                               cur.forwardPos();
+                       return true;
+               }
 
-bool findPreviousChange(BufferView * bv)
-{
-       return findChange(bv, false);
+       return false;
 }
 
 
@@ -483,6 +472,20 @@ bool findChange(BufferView * bv, bool next)
 
        return true;
 }
+}
+
+
+bool findNextChange(BufferView * bv)
+{
+       return findChange(bv, true);
+}
+
+
+bool findPreviousChange(BufferView * bv)
+{
+       return findChange(bv, false);
+}
+
 
 namespace {
 
index 589a5d01d5870177a2e9a42cdfe477d42f506192..9adcae968d9c0faf26f729df98b67a7c28f1836a 100644 (file)
@@ -72,10 +72,6 @@ bool findNextChange(BufferView * bv);
 /// find the previous change in the buffer
 bool findPreviousChange(BufferView * bv);
 
-/// find the change in the buffer
-/// \param next true to find the next change, otherwise the previous
-bool findChange(BufferView * bv, bool next);
-
 class FindAndReplaceOptions {
 public:
        typedef enum {