X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxfind.cpp;h=73f6469754fe43b3ca2e903e6c893fac52491622;hb=f1f63fcad0a5512dc277fd8e401ac6cd5736c699;hp=b67f915d7c815d75f6fed65f7861d9f68f0e7437;hpb=a74153da0b736c2f6506b87d61c06213becb8036;p=lyx.git diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index b67f915d7c..73f6469754 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -271,7 +271,7 @@ pair replaceOne(BufferView * bv, docstring searchstr, if (bv->buffer().isReadonly()) return pair(false, 0); - cap::replaceSelectionWithString(cur, replacestr, forward); + cap::replaceSelectionWithString(cur, replacestr); if (forward) { cur.pos() += replacestr.length(); LASSERT(cur.pos() <= cur.lastpos(), /* */); @@ -1133,12 +1133,12 @@ int findForwardAdv(DocIterator & cur, MatchStringAdv & match) { if (!cur) return 0; - while (cur) { + while (!theApp()->longOperationCancelled() && cur) { LYXERR(Debug::FIND, "findForwardAdv() cur: " << cur); int match_len = match(cur, -1, false); LYXERR(Debug::FIND, "match_len: " << match_len); if (match_len) { - for (; cur; cur.forwardPos()) { + for (; !theApp()->longOperationCancelled() && cur; cur.forwardPos()) { LYXERR(Debug::FIND, "Advancing cur: " << cur); int match_len = match(cur); LYXERR(Debug::FIND, "match_len: " << match_len); @@ -1235,7 +1235,7 @@ int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match) { else cur.backwardPos(); pit_changed = true; - } while (true); + } while (!theApp()->longOperationCancelled()); return 0; }