[LyX/master] Slight code improvement

Juergen Spitzmueller <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 91bcd2ac39f19af518d24e34e0952aad4f424b02
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Mar 10 15:50:22 2026 +0100

    Slight code improvement
---
 src/LaTeXFeatures.cpp | 19 +++++++++----------
 src/LaTeXFeatures.h   |  2 +-
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 43084df4b5..de7086b251 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -1321,8 +1321,7 @@ string const LaTeXFeatures::getColorValue(string const & col) const
 }
 
 
-bool LaTeXFeatures::requireColorPackage(string const & col, bool const islatexcol,
-					bool const xcolor)
+bool LaTeXFeatures::requireColorPackage(string const & col, bool const islatexcol, bool xcolor)
 {
 	bool res = false;
 	if ((!islatexcol && theLaTeXColors().isLaTeXColor(col))
@@ -1331,28 +1330,28 @@ bool LaTeXFeatures::requireColorPackage(string const & col, bool const islatexco
 		LaTeXColor const lc = theLaTeXColors().getLaTeXColor(lyxcolor);
 		for (auto const & r : lc.req())
 			require(r);
+		if (!lc.model().empty()) {
+			xcolor = true;
+			require("xcolor:" + lc.model());
+		}
 		if (xcolor)
 			require("xcolor");
 		else
 			require("color");
-		if (!lc.model().empty()) {
-			require("xcolor");
-			require("xcolor:" + lc.model());
-		}
 		res = true;
 	} else {
 		for (auto const & lc : params_.documentClass().latexColors()) {
 			if ((!islatexcol && lc.first == col) || (islatexcol && lc.second.latex() == col)){
 				for (auto const & r : lc.second.req())
 					require(r);
+				if (!lc.second.model().empty()) {
+					xcolor = true;
+					require("xcolor:" + lc.second.model());
+				}
 				if (xcolor)
 					require("xcolor");
 				else
 					require("color");
-				if (!lc.second.model().empty()) {
-					require("xcolor");
-					require("xcolor:" + lc.second.model());
-				}
 				res = true;
 			}
 		}
diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h
index ff16d74d88..acbfaba62c 100644
--- a/src/LaTeXFeatures.h
+++ b/src/LaTeXFeatures.h
@@ -224,7 +224,7 @@ public:
 	bool haveOtherForceProvide() const;
 	///
 	bool requireColorPackage(std::string const & col, bool const islatexcol = false,
-				 bool const xcolor = false);
+				 bool xcolor = false);
 
 private:
 	///
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.