[LyX/master] Pass three string parameters by address

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed Sep 11 15:34:23 UTC 2024


commit eeb84bce17f74cba1c6482411fa14434a9703b7f
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Wed Sep 11 17:33:52 2024 +0200

    Pass three string parameters by address
    
    Spoted by Coverity scan.
---
 src/lyxfind.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index f72169ae66..b4cbcd6bb7 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -1136,7 +1136,8 @@ public:
 private:
 	/// Auxiliary find method (does not account for opt.matchword)
 	MatchResult findAux(DocIterator const & cur, int len, matchType at_begin) const;
-	void CreateRegexp(FindAndReplaceOptions const & opt, string regexp_str, string regexp2_str, string par_as_string = "");
+	void CreateRegexp(FindAndReplaceOptions const & opt, string const & regexp_str,
+	                  string const & regexp2_str, string const & par_as_string = string());
 
 	/** Normalize a stringified or latexified LyX paragraph.
 	 **
@@ -3619,7 +3620,8 @@ static void identifyClosing(string & t, bool ignoreformat)
 static int num_replaced = 0;
 static bool previous_single_replace = true;
 
-void MatchStringAdv::CreateRegexp(FindAndReplaceOptions const & opt, string regexp_str, string regexp2_str, string par_as_string)
+void MatchStringAdv::CreateRegexp(FindAndReplaceOptions const & opt, string const & regexp_str,
+                                  string const & regexp2_str, string const & par_as_string)
 {
 #if QTSEARCH
 	if (regexp_str.empty() || regexp2_str.empty()) {


More information about the lyx-cvs mailing list