]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetQuotes.cpp
InsetIndex: revamp IndexEntry to handle both legacy and modern index insets; simplify...
[features.git] / src / insets / InsetQuotes.cpp
index dc6dbba68bfabe51092ca854e944957bbea8544f..1882769cc0e18ece5a62faccbdb7ea2042207ed6 100644 (file)
@@ -851,7 +851,7 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
        docstring qstr;
 
        // In pass-thru context, we output plain quotes
-       if (runparams.pass_thru)
+       if (runparams.pass_thru || runparams.for_search != OutputParams::NoSearch)
                qstr = (level_ == QuoteLevel::Primary) ? from_ascii("\"") : from_ascii("'");
        else if (style == QuoteStyle::Plain && fontspec_) {
                // For XeTeX and LuaTeX,we need to disable mapping to get straight
@@ -942,11 +942,20 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
 
 
 int InsetQuotes::plaintext(odocstringstream & os,
-        OutputParams const &, size_t) const
+        OutputParams const & op, size_t) const
 {
-       docstring const str = displayString();
-       os << str;
-       return str.size();
+       if (op.for_search == OutputParams::NoSearch) {
+               docstring const str = displayString();
+               os << str;
+               return str.size();
+       }
+       else {
+               if (level_ == QuoteLevel::Primary)
+                       os << from_ascii("\"");
+               else
+                       os << from_ascii("'");
+               return 1;
+       }
 }