X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxfind.cpp;h=444db69a9896c72c6837b60690b6d9edb769f1df;hb=e4b80698be91708ce1b9fd86d6032245ef4f3dc7;hp=d1c91c514d1dab467c4d4498b4ac852e024360ea;hpb=a3e10cd067b4a49aabc7416777ac796d85c032d0;p=lyx.git diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index d1c91c514d..444db69a98 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -3225,6 +3225,7 @@ void MatchStringAdv::CreateRegexp(FindAndReplaceOptions const & opt, string rege regexError += "Invalid regexp2 \"" + regexp2_str + "\", error = " + regexp2.errorString().toStdString(); } #else + (void)par_as_string; if (opt.casesensitive) { regexp = regex(regexp_str); regexp2 = regex(regexp2_str); @@ -3327,7 +3328,7 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions & opt) string lead_as_regexp; if (lead_size > 0) { lead_as_regexp = string2regex(par_as_string.substr(0, lead_size)); - regex_replace(par_as_string_nolead, par_as_string_nolead, "}$", ""); + (void)regex_replace(par_as_string_nolead, par_as_string_nolead, "}$", ""); par_as_string = par_as_string_nolead; LYXERR(Debug::FIND, "lead_as_regexp is '" << lead_as_regexp << "'"); LYXERR(Debug::FIND, "par_as_string now is '" << par_as_string << "'"); @@ -4283,10 +4284,10 @@ static int findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, Ma ostringstream oss; repl_buffer_orig.write(oss); string lyx = oss.str(); - if (matchAdv.valid_matches > 0) { - replaceMatches(lyx, matchAdv.valid_matches, matchAdv.matches); - } - Buffer repl_buffer("", false); + if (matchAdv.valid_matches > 0) + replaceMatches(lyx, matchAdv.valid_matches, matchAdv.matches); + Buffer repl_buffer(string(), false); + repl_buffer.setInternal(true); repl_buffer.setUnnamed(true); LASSERT(repl_buffer.readString(lyx), return 0); if (opt.keep_case && sel_len >= 2) {