]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.cpp
Check path of Qt tools if qtchooser is detected
[lyx.git] / src / lyxfind.cpp
index 85b66d071588639d32e4447c9f0358897e016e04..cc8d1cf12ff07abb9c6b74cf476a117862e6ecc5 100644 (file)
@@ -385,7 +385,6 @@ bool lyxreplace(BufferView * bv,
                else
                        bv->message(_("String not found."));
        }
-       bv->buffer().updatePreviews();
        return update;
 }
 
@@ -728,9 +727,8 @@ private:
 static docstring buffer_to_latex(Buffer & buffer)
 {
        OutputParams runparams(&buffer.params().encoding());
-       TexRow texrow(false);
        odocstringstream ods;
-       otexstream os(ods, texrow);
+       otexstream os(ods, false);
        runparams.nice = true;
        runparams.flavor = OutputParams::LATEX;
        runparams.linelen = 80; //lyxrc.plaintext_linelen;
@@ -1049,9 +1047,8 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
        Buffer const & buf = *cur.buffer();
        LBUFERR(buf.params().isLatex());
 
-       TexRow texrow(false);
        odocstringstream ods;
-       otexstream os(ods, texrow);
+       otexstream os(ods, false);
        OutputParams runparams(&buf.params().encoding());
        runparams.nice = false;
        runparams.flavor = OutputParams::LATEX;
@@ -1072,7 +1069,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
                for (int s = cur.depth() - 1; s >= 0; --s) {
                        CursorSlice const & cs = cur[s];
                        if (cs.asInsetMath() && cs.asInsetMath()->asHullInset()) {
-                               WriteStream ws(ods);
+                               WriteStream ws(os);
                                cs.asInsetMath()->asHullInset()->header_write(ws);
                                break;
                        }
@@ -1094,7 +1091,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
                        CursorSlice const & cs = cur[s];
                        InsetMath * inset = cs.asInsetMath();
                        if (inset && inset->asHullInset()) {
-                               WriteStream ws(ods);
+                               WriteStream ws(os);
                                inset->asHullInset()->footer_write(ws);
                                break;
                        }
@@ -1396,9 +1393,8 @@ static void findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, M
                LYXERR(Debug::FIND, "After pasteParagraphList() cur=" << cur << endl);
                sel_len = repl_buffer.paragraphs().begin()->size();
        } else if (cur.inMathed()) {
-               TexRow texrow(false);
                odocstringstream ods;
-               otexstream os(ods, texrow);
+               otexstream os(ods, false);
                OutputParams runparams(&repl_buffer.params().encoding());
                runparams.nice = false;
                runparams.flavor = OutputParams::LATEX;
@@ -1409,6 +1405,8 @@ static void findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, M
                docstring repl_latex = ods.str();
                LYXERR(Debug::FIND, "Latexified replace_buffer: '" << repl_latex << "'");
                string s;
+               // false positive from coverity
+               // coverity[CHECKED_RETURN]
                regex_replace(to_utf8(repl_latex), s, "\\$(.*)\\$", "$1");
                regex_replace(s, s, "\\\\\\[(.*)\\\\\\]", "$1");
                repl_latex = from_utf8(s);
@@ -1426,7 +1424,6 @@ static void findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, M
        LYXERR(Debug::FIND, "After pos adj cur=" << cur << " with depth: " << cur.depth() << " and len: " << sel_len);
        bv->putSelectionAt(DocIterator(cur), sel_len, !opt.forward);
        bv->processUpdateFlags(Update::Force);
-       bv->buffer().updatePreviews();
 }