From c2229d388b622a65029d0566f5eca53b43d92528 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Tue, 12 Apr 2022 18:02:12 +0200 Subject: [PATCH] Find: Renamend for_searchAdv to for_serach in src/OutputParams.h Since this variable is used by quick find too, the naming was misleading --- src/OutputParams.h | 2 +- src/Paragraph.cpp | 10 ++++---- src/insets/InsetBibtex.cpp | 2 +- src/insets/InsetBranch.cpp | 4 ++-- src/insets/InsetInclude.cpp | 4 ++-- src/insets/InsetIndex.cpp | 2 +- src/insets/InsetNote.cpp | 14 ++++++------ src/insets/InsetQuotes.cpp | 4 ++-- src/insets/InsetSpace.cpp | 44 ++++++++++++++++++------------------ src/lyxfind.cpp | 24 ++++++++++---------- src/mathed/InsetMathHull.cpp | 2 +- src/mathed/InsetMathNest.cpp | 2 +- src/output_latex.cpp | 28 +++++++++++------------ 13 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/OutputParams.h b/src/OutputParams.h index 65a58e5db9..64ab2f3cf0 100644 --- a/src/OutputParams.h +++ b/src/OutputParams.h @@ -433,7 +433,7 @@ public: SearchNonOutput = 8 }; - int for_searchAdv = NoSearch; + int for_search = NoSearch; /// Are we generating this material for instant preview? bool for_preview = false; diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 77465974bf..434e515ccb 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1209,10 +1209,10 @@ void Paragraph::Private::latexSpecialChar(otexstream & os, { char_type const c = owner_->getUChar(bparams, runparams, i); - if (style.pass_thru || runparams.pass_thru || (runparams.for_searchAdv != OutputParams::NoSearch) + if (style.pass_thru || runparams.pass_thru || (runparams.for_search != OutputParams::NoSearch) || contains(style.pass_thru_chars, c) || contains(runparams.pass_thru_chars, c)) { - if (runparams.for_searchAdv != OutputParams::NoSearch) { + if (runparams.for_search != OutputParams::NoSearch) { if (c == '\\') os << "\\\\"; else if (c == '{') @@ -2640,10 +2640,10 @@ void Paragraph::latex(BufferParams const & bparams, // Check whether a display math inset follows bool output_changes; - if (runparams.for_searchAdv == OutputParams::NoSearch) + if (runparams.for_search == OutputParams::NoSearch) output_changes = bparams.output_changes; else - output_changes = ((runparams.for_searchAdv & OutputParams::SearchWithDeleted) != 0); + output_changes = ((runparams.for_search & OutputParams::SearchWithDeleted) != 0); if (c == META_INSET && i >= start_pos && (end_pos == -1 || i < end_pos)) { if (isDeleted(i)) @@ -4586,7 +4586,7 @@ int Paragraph::find(docstring const & str, bool cs, bool mw, odocstringstream os; if (inset->lyxCode() == lyx::QUOTE_CODE) { OutputParams op(0); - op.for_searchAdv = OutputParams::SearchQuick; + op.for_search = OutputParams::SearchQuick; inset->plaintext(os, op); } else { diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 5f6b967680..4e02b628f3 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -983,7 +983,7 @@ int InsetBibtex::plaintext(odocstringstream & os, // We could output more information here, e.g., what databases are included // and information about options. But I don't necessarily see any reason to // do this right now. - if (op.for_tooltip || op.for_toc || op.for_searchAdv != OutputParams::NoSearch) { + if (op.for_tooltip || op.for_toc || op.for_search != OutputParams::NoSearch) { os << '[' << reflabel << ']' << '\n'; return PLAINTEXT_NEWLINE; } diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 2b60ca6f44..7a102ceab6 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -314,7 +314,7 @@ bool InsetBranch::producesOutput() const void InsetBranch::latex(otexstream & os, OutputParams const & runparams) const { - if (producesOutput() || ((runparams.for_searchAdv & OutputParams::SearchNonOutput) != 0)) { + if (producesOutput() || ((runparams.for_search & OutputParams::SearchNonOutput) != 0)) { OutputParams rp = runparams; rp.inbranch = true; InsetText::latex(os, rp); @@ -328,7 +328,7 @@ void InsetBranch::latex(otexstream & os, OutputParams const & runparams) const int InsetBranch::plaintext(odocstringstream & os, OutputParams const & runparams, size_t max_length) const { - if (!producesOutput() && ((runparams.for_searchAdv & OutputParams::SearchNonOutput) == 0)) + if (!producesOutput() && ((runparams.for_search & OutputParams::SearchNonOutput) == 0)) return 0; int len = InsetText::plaintext(os, runparams, max_length); diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 30eacd7028..9ee08a33d6 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -1006,14 +1006,14 @@ int InsetInclude::plaintext(odocstringstream & os, { // just write the filename if we're making a tooltip or toc entry, // or are generating this for advanced search - if (op.for_tooltip || op.for_toc || op.for_searchAdv != OutputParams::NoSearch) { + if (op.for_tooltip || op.for_toc || op.for_search != OutputParams::NoSearch) { os << '[' << screenLabel() << '\n' << ltrim(getParam("filename")) << "\n]"; return PLAINTEXT_NEWLINE + 1; // one char on a separate line } if (isVerbatim(params()) || isListings(params())) { - if (op.for_searchAdv != OutputParams::NoSearch) { + if (op.for_search != OutputParams::NoSearch) { os << '[' << screenLabel() << ']'; } else { diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index fe0890c4ae..86222635e3 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -85,7 +85,7 @@ void InsetIndex::latex(otexstream & ios, OutputParams const & runparams_in) cons odocstringstream ourlatex; otexstream ots(ourlatex); InsetText::latex(ots, runparams); - if (runparams.for_searchAdv != OutputParams::NoSearch) { + if (runparams.for_search != OutputParams::NoSearch) { // No need for special handling, if we are only searching for some patterns os << ourlatex.str() << "}"; return; diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 0324ca86fd..45d89d0f13 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -207,12 +207,12 @@ bool InsetNote::isMacroScope() const void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const { if (params_.type != InsetNoteParams::Greyedout - && runparams_in.for_searchAdv != OutputParams::NoSearch - && (runparams_in.for_searchAdv & OutputParams::SearchNonOutput) == 0) + && runparams_in.for_search != OutputParams::NoSearch + && (runparams_in.for_search & OutputParams::SearchNonOutput) == 0) return; if (params_.type == InsetNoteParams::Note) { - if ((runparams_in.for_searchAdv & OutputParams::SearchNonOutput) != 0) { + if ((runparams_in.for_search & OutputParams::SearchNonOutput) != 0) { OutputParams runparams(runparams_in); InsetCollapsible::latex(os, runparams); runparams_in.encoding = runparams.encoding; @@ -251,11 +251,11 @@ void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const int InsetNote::plaintext(odocstringstream & os, OutputParams const & runparams_in, size_t max_length) const { - if ((runparams_in.for_searchAdv & OutputParams::SearchNonOutput) == 0) { + if ((runparams_in.for_search & OutputParams::SearchNonOutput) == 0) { if (params_.type == InsetNoteParams::Note) return 0; else if (params_.type == InsetNoteParams::Comment - && (runparams_in.for_searchAdv != OutputParams::NoSearch)) + && (runparams_in.for_search != OutputParams::NoSearch)) return 0; } @@ -265,10 +265,10 @@ int InsetNote::plaintext(odocstringstream & os, // Ignore files that are exported inside a comment runparams.exportdata.reset(new ExportData); } - if ((runparams_in.for_searchAdv & OutputParams::SearchNonOutput) == 0) + if ((runparams_in.for_search & OutputParams::SearchNonOutput) == 0) os << '[' << buffer().B_("note") << ":\n"; InsetText::plaintext(os, runparams, max_length); - if ((runparams_in.for_searchAdv & OutputParams::SearchNonOutput) == 0) + if ((runparams_in.for_search & OutputParams::SearchNonOutput) == 0) os << "\n]"; return PLAINTEXT_NEWLINE + 1; // one char on a separate line diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp index 67ad7672dd..1882769cc0 100644 --- a/src/insets/InsetQuotes.cpp +++ b/src/insets/InsetQuotes.cpp @@ -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 || runparams.for_searchAdv != OutputParams::NoSearch) + 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 @@ -944,7 +944,7 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const int InsetQuotes::plaintext(odocstringstream & os, OutputParams const & op, size_t) const { - if (op.for_searchAdv == OutputParams::NoSearch) { + if (op.for_search == OutputParams::NoSearch) { docstring const str = displayString(); os << str; return str.size(); diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index 1a2eb096b7..92d4c43609 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -579,27 +579,27 @@ void InsetSpace::latex(otexstream & os, OutputParams const & runparams) const { switch (params_.kind) { case InsetSpaceParams::NORMAL: - os << (runparams.free_spacing && (runparams.for_searchAdv == OutputParams::NoSearch) ? " " : "\\ "); + os << (runparams.free_spacing && (runparams.for_search == OutputParams::NoSearch) ? " " : "\\ "); break; case InsetSpaceParams::PROTECTED: if (runparams.local_font && runparams.local_font->language()->lang() == "polutonikogreek") // in babel's polutonikogreek, ~ is active - os << (runparams.free_spacing && (runparams.for_searchAdv == OutputParams::NoSearch) ? " " : "\\nobreakspace{}"); + os << (runparams.free_spacing && (runparams.for_search == OutputParams::NoSearch) ? " " : "\\nobreakspace{}"); else - os << (runparams.free_spacing && (runparams.for_searchAdv == OutputParams::NoSearch) ? ' ' : '~'); + os << (runparams.free_spacing && (runparams.for_search == OutputParams::NoSearch) ? ' ' : '~'); break; case InsetSpaceParams::VISIBLE: - os << (runparams.free_spacing && (runparams.for_searchAdv == OutputParams::NoSearch) ? " " : "\\textvisiblespace{}"); + os << (runparams.free_spacing && (runparams.for_search == OutputParams::NoSearch) ? " " : "\\textvisiblespace{}"); break; case InsetSpaceParams::THIN: - if (runparams.for_searchAdv != OutputParams::NoSearch) + if (runparams.for_search != OutputParams::NoSearch) os << "\\thinspace{}"; else os << (runparams.free_spacing ? " " : "\\,"); break; case InsetSpaceParams::MEDIUM: - if (runparams.for_searchAdv != OutputParams::NoSearch) + if (runparams.for_search != OutputParams::NoSearch) os << "\\medspace{}"; else if (params_.math) os << (runparams.free_spacing ? " " : "\\:"); @@ -607,7 +607,7 @@ void InsetSpace::latex(otexstream & os, OutputParams const & runparams) const os << (runparams.free_spacing ? " " : "\\medspace{}"); break; case InsetSpaceParams::THICK: - if (runparams.for_searchAdv != OutputParams::NoSearch) + if (runparams.for_search != OutputParams::NoSearch) os << "\\thickspace{}"; else if (params_.math) os << (runparams.free_spacing ? " " : "\\;"); @@ -615,49 +615,49 @@ void InsetSpace::latex(otexstream & os, OutputParams const & runparams) const os << (runparams.free_spacing ? " " : "\\thickspace{}"); break; case InsetSpaceParams::QUAD: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\quad{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\quad{}"); break; case InsetSpaceParams::QQUAD: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\qquad{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\qquad{}"); break; case InsetSpaceParams::ENSPACE: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\enspace{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\enspace{}"); break; case InsetSpaceParams::ENSKIP: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\enskip{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\enskip{}"); break; case InsetSpaceParams::NEGTHIN: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\negthinspace{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\negthinspace{}"); break; case InsetSpaceParams::NEGMEDIUM: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\negmedspace{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\negmedspace{}"); break; case InsetSpaceParams::NEGTHICK: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\negthickspace{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\negthickspace{}"); break; case InsetSpaceParams::HFILL: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\hfill{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\hfill{}"); break; case InsetSpaceParams::HFILL_PROTECTED: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\hspace*{\\fill}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\hspace*{\\fill}"); break; case InsetSpaceParams::DOTFILL: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\dotfill{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\dotfill{}"); break; case InsetSpaceParams::HRULEFILL: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\hrulefill{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\hrulefill{}"); break; case InsetSpaceParams::LEFTARROWFILL: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\leftarrowfill{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\leftarrowfill{}"); break; case InsetSpaceParams::RIGHTARROWFILL: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\rightarrowfill{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\rightarrowfill{}"); break; case InsetSpaceParams::UPBRACEFILL: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\upbracefill{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\upbracefill{}"); break; case InsetSpaceParams::DOWNBRACEFILL: - os << (runparams.free_spacing && (runparams.for_searchAdv != OutputParams::NoSearch) ? " " : "\\downbracefill{}"); + os << (runparams.free_spacing && (runparams.for_search != OutputParams::NoSearch) ? " " : "\\downbracefill{}"); break; case InsetSpaceParams::CUSTOM: if (runparams.free_spacing) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index c3f2b77929..6ef7cd3b62 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1098,11 +1098,11 @@ static docstring buffer_to_latex(Buffer & buffer) // No side effect of file copying and image conversion runparams.dryrun = true; if (ignoreFormats.getDeleted()) - runparams.for_searchAdv = OutputParams::SearchWithoutDeleted; + runparams.for_search = OutputParams::SearchWithoutDeleted; else - runparams.for_searchAdv = OutputParams::SearchWithDeleted; + runparams.for_search = OutputParams::SearchWithDeleted; if (ignoreFormats.getNonContent()) { - runparams.for_searchAdv |= OutputParams::SearchNonOutput; + runparams.for_search |= OutputParams::SearchNonOutput; } pit_type const endpit = buffer.paragraphs().size(); for (pit_type pit = 0; pit != endpit; ++pit) { @@ -1174,13 +1174,13 @@ static docstring stringifySearchBuffer(Buffer & buffer, FindAndReplaceOptions co int option = AS_STR_INSETS |AS_STR_PLAINTEXT; if (ignoreFormats.getDeleted()) { option |= AS_STR_SKIPDELETE; - runparams.for_searchAdv = OutputParams::SearchWithoutDeleted; + runparams.for_search = OutputParams::SearchWithoutDeleted; } else { - runparams.for_searchAdv = OutputParams::SearchWithDeleted; + runparams.for_search = OutputParams::SearchWithDeleted; } if (ignoreFormats.getNonContent()) { - runparams.for_searchAdv |= OutputParams::SearchNonOutput; + runparams.for_search |= OutputParams::SearchNonOutput; } string t(""); for (pos_type pit = pos_type(0); pit < (pos_type)buffer.paragraphs().size(); ++pit) { @@ -3952,13 +3952,13 @@ docstring stringifyFromCursor(DocIterator const & cur, int len) int option = AS_STR_INSETS | AS_STR_PLAINTEXT; if (ignoreFormats.getDeleted()) { option |= AS_STR_SKIPDELETE; - runparams.for_searchAdv = OutputParams::SearchWithoutDeleted; + runparams.for_search = OutputParams::SearchWithoutDeleted; } else { - runparams.for_searchAdv = OutputParams::SearchWithDeleted; + runparams.for_search = OutputParams::SearchWithDeleted; } if (ignoreFormats.getNonContent()) { - runparams.for_searchAdv |= OutputParams::SearchNonOutput; + runparams.for_search |= OutputParams::SearchNonOutput; } LYXERR(Debug::FIND, "Stringifying with cur: " << cur << ", from pos: " << cur.pos() << ", end: " << end); @@ -4006,13 +4006,13 @@ docstring latexifyFromCursor(DocIterator const & cur, int len) // No side effect of file copying and image conversion runparams.dryrun = true; if (ignoreFormats.getDeleted()) { - runparams.for_searchAdv = OutputParams::SearchWithoutDeleted; + runparams.for_search = OutputParams::SearchWithoutDeleted; } else { - runparams.for_searchAdv = OutputParams::SearchWithDeleted; + runparams.for_search = OutputParams::SearchWithDeleted; } if (ignoreFormats.getNonContent()) { - runparams.for_searchAdv |= OutputParams::SearchNonOutput; + runparams.for_search |= OutputParams::SearchNonOutput; } if (cur.inTexted()) { diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 805f84c479..e266ec8672 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -2359,7 +2359,7 @@ int InsetMathHull::plaintext(odocstringstream & os, Encoding const * const enc = encodings.fromLyXName("utf8"); TeXMathStream::OutputType ot; - if (op.for_searchAdv == OutputParams::NoSearch) + if (op.for_search == OutputParams::NoSearch) ot = TeXMathStream::wsDefault; else ot = TeXMathStream::wsSearchAdv; diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 4f21924a81..d4759a0c0f 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -359,7 +359,7 @@ void InsetMathNest::normalize(NormalStream & os) const void InsetMathNest::latex(otexstream & os, OutputParams const & runparams) const { TeXMathStream::OutputType ot; - if (runparams.for_searchAdv != OutputParams::NoSearch) + if (runparams.for_search != OutputParams::NoSearch) ot = TeXMathStream::wsSearchAdv; else if (runparams.dryrun) ot = TeXMathStream::wsDryrun; diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 61537c827f..358aae5b3f 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -462,10 +462,10 @@ void TeXEnvironment(Buffer const & buf, Text const & text, // Do not output empty environments if the whole paragraph has // been deleted with ct and changes are not output. bool output_changes; - if (runparams.for_searchAdv == OutputParams::NoSearch) + if (runparams.for_search == OutputParams::NoSearch) output_changes = buf.params().output_changes; else - output_changes = ((runparams.for_searchAdv & OutputParams::SearchWithDeleted) != 0); + output_changes = ((runparams.for_search & OutputParams::SearchWithDeleted) != 0); if (size_t(pit + 1) < paragraphs.size()) { ParagraphList::const_iterator nextpar = paragraphs.iterator_at(pit + 1); Paragraph const & cpar = paragraphs.at(pit); @@ -578,7 +578,7 @@ void getArgInsets(otexstream & os, OutputParams const & runparams, Layout::LaTeX } } } - if ((runparams.for_searchAdv != OutputParams::NoSearch) && argnr > 1) { + if ((runparams.for_search != OutputParams::NoSearch) && argnr > 1) { // Mark end of arguments for findadv() only os << "\\endarguments{}"; } @@ -746,7 +746,7 @@ void parStartCommand(Paragraph const & par, otexstream & os, break; case LATEX_ITEM_ENVIRONMENT: case LATEX_LIST_ENVIRONMENT: - if (runparams.for_searchAdv != OutputParams::NoSearch) { + if (runparams.for_search != OutputParams::NoSearch) { os << "\\" + style.itemcommand() << "{" << style.latexname() << "}"; } else { @@ -758,7 +758,7 @@ void parStartCommand(Paragraph const & par, otexstream & os, } break; case LATEX_ENVIRONMENT: - if (runparams.for_searchAdv != OutputParams::NoSearch) { + if (runparams.for_search != OutputParams::NoSearch) { os << "\\latexenvironment{" << style.latexname() << "}{"; } break; @@ -796,7 +796,7 @@ void TeXOnePar(Buffer const & buf, // Do not output empty commands if the whole paragraph has // been deleted with ct and changes are not output. - if (((runparams_in.for_searchAdv & OutputParams::SearchWithDeleted) == 0) && style.latextype != LATEX_ENVIRONMENT + if (((runparams_in.for_search & OutputParams::SearchWithDeleted) == 0) && style.latextype != LATEX_ENVIRONMENT && !par.empty() && par.isDeleted(0, par.size()) && !bparams.output_changes) return; @@ -936,7 +936,7 @@ void TeXOnePar(Buffer const & buf, bool const have_prior_nptpar = prior_nontitle_par && !prior_nontitle_par->isPassThru(); Language const * const prev_language = - runparams_in.for_searchAdv != OutputParams::NoSearch + runparams_in.for_search != OutputParams::NoSearch ? languages.getLanguage("ignore") : (have_prior_nptpar) ? (use_prev_env_language @@ -988,7 +988,7 @@ void TeXOnePar(Buffer const & buf, && !(have_prior_nptpar && (prev_language->rightToLeft() != par_language->rightToLeft())); bool const localswitch = - (runparams_in.for_searchAdv != OutputParams::NoSearch + (runparams_in.for_search != OutputParams::NoSearch || text.inset().forceLocalFontSwitch() || (using_begin_end && text.inset().forcePlainLayout()) || in_polyglossia_rtl_env) @@ -1003,7 +1003,7 @@ void TeXOnePar(Buffer const & buf, bool const localswitch_needed = localswitch && par_lang != outer_lang; // localswitches need to be closed and reopened at each par - if ((runparams_in.for_searchAdv != OutputParams::NoSearch) || ((par_lang != prev_lang || localswitch_needed) + if ((runparams_in.for_search != OutputParams::NoSearch) || ((par_lang != prev_lang || localswitch_needed) // check if we already put language command in TeXEnvironment() && !(style.isEnvironment() && (pit == 0 || (priorpar->layout() != par.layout() @@ -1071,7 +1071,7 @@ void TeXOnePar(Buffer const & buf, // With CJK, the CJK tag has to be closed first (see below) if ((runparams.encoding->package() != Encoding::CJK || bparams.useNonTeXFonts - || (runparams.for_searchAdv != OutputParams::NoSearch)) + || (runparams.for_search != OutputParams::NoSearch)) && (par_lang != openLanguageName(state) || localswitch || intitle_command) && !par_lang.empty()) { string bc = use_polyglossia ? @@ -1312,7 +1312,7 @@ void TeXOnePar(Buffer const & buf, // when the paragraph uses CJK, the language has to be closed earlier if ((font.language()->encoding()->package() != Encoding::CJK) || bparams.useNonTeXFonts - || (runparams_in.for_searchAdv != OutputParams::NoSearch)) { + || (runparams_in.for_search != OutputParams::NoSearch)) { if (lang_end_command.empty()) { // If this is a child, we should restore the // master language after the last paragraph. @@ -1708,10 +1708,10 @@ void latexParagraphs(Buffer const & buf, // Do not output empty environments if the whole paragraph has // been deleted with ct and changes are not output. bool output_changes; - if (runparams.for_searchAdv == OutputParams::NoSearch) + if (runparams.for_search == OutputParams::NoSearch) output_changes = bparams.output_changes; else - output_changes = ((runparams.for_searchAdv & OutputParams::SearchWithDeleted) != 0); + output_changes = ((runparams.for_search & OutputParams::SearchWithDeleted) != 0); bool const lastpar = size_t(pit + 1) >= paragraphs.size(); if (!lastpar) { ParagraphList::const_iterator nextpar = paragraphs.iterator_at(pit + 1); @@ -1854,7 +1854,7 @@ pair switchEncoding(odocstream & os, BufferParams const & bparams, || oldEnc.package() == Encoding::japanese || oldEnc.package() == Encoding::none || newEnc.package() == Encoding::none - || (runparams.for_searchAdv != OutputParams::NoSearch)) + || (runparams.for_search != OutputParams::NoSearch)) return make_pair(false, 0); // FIXME We ignore encoding switches from/to encodings that do // neither support the inputenc package nor the CJK package here.