Just refactoring patch 5e5115c3 in simpler terms.

This commit is contained in:
Tommaso Cucinotta 2013-04-04 00:50:02 +01:00
parent 5e5115c376
commit 6ea1479252

View 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)