]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetIndex.cpp
FindAdv: Simplify search for chars '&', '%', '#' and '_'
[lyx.git] / src / insets / InsetIndex.cpp
index 113ba77fc7f943a0d52ab9a2951427a85924b7a2..9ac768060fe8b7162338fff07c9b781c11b9bb43 100644 (file)
@@ -74,19 +74,19 @@ void InsetIndex::latex(otexstream & os, OutputParams const & runparams_in) const
                os << '{';
        }
 
-       odocstringstream ourplain;
-       InsetText::plaintext(ourplain, runparams);
+       odocstringstream ourlatex;
+       otexstream ots(ourlatex);
+       InsetText::latex(ots, runparams);
        if (runparams.for_search) {
                // No need for special handling, if we are only searching for some patterns
-               os << ourplain.str() << "}";
+               os << ourlatex.str() << "}";
                return;
        }
        // get contents of InsetText as LaTeX and plaintext
-       odocstringstream ourlatex;
+       odocstringstream ourplain;
+       InsetText::plaintext(ourplain, runparams);
        // FIXME: do Tex/Row correspondence (I don't currently understand what is
        // being generated from latexstr below)
-       otexstream ots(ourlatex);
-       InsetText::latex(ots, runparams);
        docstring latexstr = ourlatex.str();
        docstring plainstr = ourplain.str();