]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.cpp
Cache icons of dynamic menu buttons
[lyx.git] / src / lyxfind.cpp
index d1c91c514d1dab467c4d4498b4ac852e024360ea..444db69a9896c72c6837b60690b6d9edb769f1df 100644 (file)
@@ -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) {