]> git.lyx.org Git - features.git/commitdiff
FindAdv: Use plain text as value for \index{}
authorKornel Benko <kornel@lyx.org>
Thu, 29 Nov 2018 10:57:11 +0000 (11:57 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:51 +0000 (14:39 +0200)
If we are in search mode, there is no need for
any special handling.

src/insets/InsetIndex.cpp

index 05da188678e31f0008f13186c8c9f0aad9a9e45b..113ba77fc7f943a0d52ab9a2951427a85924b7a2 100644 (file)
@@ -74,14 +74,19 @@ void InsetIndex::latex(otexstream & os, OutputParams const & runparams_in) const
                os << '{';
        }
 
+       odocstringstream ourplain;
+       InsetText::plaintext(ourplain, runparams);
+       if (runparams.for_search) {
+               // No need for special handling, if we are only searching for some patterns
+               os << ourplain.str() << "}";
+               return;
+       }
        // get contents of InsetText as LaTeX and plaintext
        odocstringstream ourlatex;
        // FIXME: do Tex/Row correspondence (I don't currently understand what is
        // being generated from latexstr below)
        otexstream ots(ourlatex);
        InsetText::latex(ots, runparams);
-       odocstringstream ourplain;
-       InsetText::plaintext(ourplain, runparams);
        docstring latexstr = ourlatex.str();
        docstring plainstr = ourplain.str();