Am Fri, 18 Feb 2022 11:16:53 +0100
schrieb Jürgen Spitzmüller <sp...@lyx.org>:

> Am Freitag, dem 18.02.2022 um 10:31 +0100 schrieb Kornel Benko:
> > Given the string 'ABCD' while 'B' is in deactivated branch.
> > Now considering the case searching for the word 'ACD'.
> > Should it be found?  
> 
> Don't know.
> 
> But if a deactivated branch (or note) contains one or several
> paragraphs, strings there should be found. This seems to be the more
> common use case (or at least how I use branches more commonly).
> 
> Thus I'd make that optional.
> 
> Jürgen
> 

Does the attached work as expected?

        Kornel

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel
diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index be8e551747..767cbbf0f5 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -312,11 +312,11 @@ bool InsetBranch::producesOutput() const
 }
 
 
 void InsetBranch::latex(otexstream & os, OutputParams const & runparams) const
 {
-	if (producesOutput()) {
+	if (producesOutput() || runparams.for_searchAdv != OutputParams::NoSearch) {
 		OutputParams rp = runparams;
 		rp.inbranch = true;
 		InsetText::latex(os, rp);
 		// These need to be passed upstream
 		runparams.need_maketitle = rp.need_maketitle;
@@ -326,11 +326,11 @@ void InsetBranch::latex(otexstream & os, OutputParams const & runparams) const
 
 
 int InsetBranch::plaintext(odocstringstream & os,
 			   OutputParams const & runparams, size_t max_length) const
 {
-	if (!producesOutput())
+	if (!producesOutput() && runparams.for_searchAdv == OutputParams::NoSearch)
 		return 0;
 
 	int len = InsetText::plaintext(os, runparams, max_length);
 	return len;
 }

Attachment: pgpzTbqmKGmgZ.pgp
Description: Digitale Signatur von OpenPGP

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to