]> git.lyx.org Git - features.git/commitdiff
* lyxfind: Remove unnecessary non-const reference as parameter.
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 2 May 2010 22:33:36 +0000 (22:33 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 2 May 2010 22:33:36 +0000 (22:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34355 a592a061-630c-0410-9148-cb99ea01b6c8

src/lyxfind.cpp

index fd44187104fdb9a6d80ed04f18cb54c0875f562b..82c8728656f22a2fcbee4fd46687f0939ca5a54c 100644 (file)
@@ -983,11 +983,11 @@ int findForwardAdv(DocIterator & cur, MatchStringAdv & match)
 
 
 /// Find the most backward consecutive match within same paragraph while searching backwards.
-void findMostBackwards(DocIterator & cur, MatchStringAdv const & match, int & len)
+int findMostBackwards(DocIterator & cur, MatchStringAdv const & match)
 {
        DocIterator cur_begin = doc_iterator_begin(cur.buffer());
        DocIterator tmp_cur = cur;
-       len = findAdvFinalize(tmp_cur, match);
+       int len = findAdvFinalize(tmp_cur, match);
        Inset & inset = cur.inset();
        for (; cur != cur_begin; cur.backwardPos()) {
                LYXERR(Debug::FIND, "findMostBackwards(): cur=" << cur);
@@ -1001,6 +1001,7 @@ void findMostBackwards(DocIterator & cur, MatchStringAdv const & match, int & le
                len = new_len;
        }
        LYXERR(Debug::FIND, "findMostBackwards(): exiting with cur=" << cur);
+       return len;
 }
 
 
@@ -1032,11 +1033,9 @@ int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match) {
                                found_match = match(cur);
                                LYXERR(Debug::FIND, "findBackAdv3: found_match=" 
                                       << found_match << ", cur: " << cur);
-                               if (found_match) {
-                                       int len;
-                                       findMostBackwards(cur, match, len);
-                                       return len;
-                               }
+                               if (found_match)
+                                       return findMostBackwards(cur, match);
+
                                // Stop if begin of document reached
                                if (cur == cur_begin)
                                        break;