From d8ac21df310bac12fec594fdff22daab2d904069 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Thu, 29 Nov 2018 11:57:11 +0100 Subject: [PATCH] FindAdv: Use plain text as value for \index{} If we are in search mode, there is no need for any special handling. --- src/insets/InsetIndex.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); -- 2.39.5