[LyX/master] Fix bug 12459

Juergen Spitzmueller spitz at lyx.org
Sat Jan 22 08:00:49 UTC 2022


commit 942538c02d840753e16981636998e0c60c752b73
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Jan 22 09:30:25 2022 +0100

    Fix bug 12459
    
    When checking for branch color, take into account that some branches
    are defined in the master document only, some only in the child.
---
 src/insets/InsetBranch.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index 66cc6ef..be8e551 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -136,9 +136,11 @@ ColorCode InsetBranch::backgroundColor(PainterInfo const & pi) const
 {
 	if (params_.branch.empty())
 		return Inset::backgroundColor(pi);
+	string const branch_id = (buffer().masterParams().branchlist().find(params_.branch))
+			? convert<string>(buffer().masterParams().branchlist().id())
+			: convert<string>(buffer().params().branchlist().id());
 	// FIXME UNICODE
-	string const branchcol = "branch" + convert<string>(buffer().params().branchlist().id())
-			+ to_utf8(params_.branch);
+	string const branchcol = "branch" + branch_id + to_utf8(params_.branch);
 	ColorCode c = lcolor.getFromLyXName(branchcol);
 	if (c == Color_none)
 		c = Color_error;


More information about the lyx-cvs mailing list