From: Kornel Benko Date: Thu, 29 Nov 2018 10:57:11 +0000 (+0100) Subject: FindAdv: Use plain text as value for \index{} X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d8ac21df310bac12fec594fdff22daab2d904069;p=features.git FindAdv: Use plain text as value for \index{} If we are in search mode, there is no need for any special handling. --- diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 05da188678..113ba77fc7 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -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();