commit de4ca7b742c5493f4b53affe615bd5c22ad525eb
Author: Kornel Benko <[email protected]>
Date:   Thu Nov 29 11:57:11 2018 +0100

    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 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp
index 05da188..113ba77 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();
 

Reply via email to