]> git.lyx.org Git - features.git/commitdiff
Sett forward to true by default in search string parsing
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 15 Feb 2021 08:41:16 +0000 (09:41 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 15 Feb 2021 08:44:27 +0000 (09:44 +0100)
src/lyxfind.cpp

index 61176b9805f0b7e1126030f3776c33d32892810c..ffbd923318de88353b574bae0fba05f1c887c9d8 100644 (file)
@@ -191,10 +191,10 @@ void setIgnoreFormat(string const & type, bool value, bool fromUser)
 
 namespace {
 
-bool parse_bool(docstring & howto)
+bool parse_bool(docstring & howto, bool const defvalue = false)
 {
        if (howto.empty())
-               return false;
+               return defvalue;
        docstring var;
        howto = split(howto, var, ' ');
        return var == "1";
@@ -482,7 +482,7 @@ docstring const string2find(docstring const & argument,
 
        casesensitive = parse_bool(howto);
        matchword     = parse_bool(howto);
-       forward       = parse_bool(howto);
+       forward       = parse_bool(howto, true);
 
        return search;
 }
@@ -520,7 +520,7 @@ bool lyxreplace(BufferView * bv, FuncRequest const & ev)
        bool casesensitive = parse_bool(howto);
        bool matchword     = parse_bool(howto);
        bool all           = parse_bool(howto);
-       bool forward       = parse_bool(howto);
+       bool forward       = parse_bool(howto, true);
        bool findnext      = howto.empty() ? true : parse_bool(howto);
 
        bool update = false;