]> git.lyx.org Git - features.git/commitdiff
Just refactoring patch 5e5115c3 in simpler terms.
authorTommaso Cucinotta <tommaso@lyx.org>
Wed, 3 Apr 2013 23:50:02 +0000 (00:50 +0100)
committerTommaso Cucinotta <tommaso@lyx.org>
Wed, 3 Apr 2013 23:50:02 +0000 (00:50 +0100)
src/lyxfind.cpp

index 62255c4ba91065625bb50d911b333a2e6bebae82..50a50598e7566906a9e57fdfe539cd9626016b75 100644 (file)
@@ -1446,13 +1446,8 @@ bool findAdv(BufferView * bv, FindAndReplaceOptions const & opt)
        try {
                MatchStringAdv matchAdv(bv->buffer(), opt);
                int length = bv->cursor().selectionEnd().pos() - bv->cursor().selectionBegin().pos();
-               if (length > 0) {
-                       LYXERR(Debug::FIND, "Putting selection at cur=" << cur << " with length: " << length << " and direction: " << !opt.forward);
-                       if (opt.forward)
-                               bv->putSelectionAt(bv->cursor().selectionBegin(), length, false);
-                       else
-                               bv->putSelectionAt(bv->cursor().selectionBegin(), length, true);
-               }
+               if (length > 0)
+                       bv->putSelectionAt(bv->cursor().selectionBegin(), length, !opt.forward);
                findAdvReplace(bv, opt, matchAdv);
                cur = bv->cursor();
                if (opt.forward)