From 6ea14792523e75bd443981ce9244929bf7964705 Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Thu, 4 Apr 2013 00:50:02 +0100 Subject: [PATCH] Just refactoring patch 5e5115c3 in simpler terms. --- src/lyxfind.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 62255c4ba9..50a50598e7 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -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)