From 681334ce20987beae57c55f9a1796b2eefd41944 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Mon, 4 Apr 2022 10:46:55 +0200 Subject: [PATCH] FindAdv: Amend 6e7fd68c: Handle InsetNoteParams::Comment too --- src/insets/InsetNote.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 40194fa6ac..0324ca86fd 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -251,12 +251,16 @@ 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 (params_.type == InsetNoteParams::Note - && (runparams_in.for_searchAdv & OutputParams::SearchNonOutput) == 0) - return 0; + if ((runparams_in.for_searchAdv & OutputParams::SearchNonOutput) == 0) { + if (params_.type == InsetNoteParams::Note) + return 0; + else if (params_.type == InsetNoteParams::Comment + && (runparams_in.for_searchAdv != OutputParams::NoSearch)) + return 0; + } OutputParams runparams(runparams_in); - if (params_.type == InsetNoteParams::Comment) { + if (params_.type != InsetNoteParams::Greyedout) { runparams.inComment = true; // Ignore files that are exported inside a comment runparams.exportdata.reset(new ExportData);