]> git.lyx.org Git - features.git/commitdiff
In mathed, require xcolor instead of color when appropriate
authorEnrico Forestieri <forenr@lyx.org>
Thu, 27 Oct 2016 01:18:29 +0000 (03:18 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 27 Oct 2016 01:18:29 +0000 (03:18 +0200)
Fixes bug #10417.

src/mathed/InsetMathColor.cpp
status.22x

index c50f61360932a519e6b6f030bd369f2f07852814..0a6d0aa6b9f21ae6691c1915322adc16fb75b89b 100644 (file)
@@ -74,8 +74,26 @@ static bool normalcolor(docstring const & color)
 void InsetMathColor::validate(LaTeXFeatures & features) const
 {
        InsetMathNest::validate(features);
-       if (!normalcolor(color_))
-               features.require("color");
+       if (!normalcolor(color_)) {
+               switch (lcolor.getFromLaTeXName(to_utf8(color_))) {
+                       case Color_brown:
+                       case Color_darkgray:
+                       case Color_gray:
+                       case Color_lightgray:
+                       case Color_lime:
+                       case Color_olive:
+                       case Color_orange:
+                       case Color_pink:
+                       case Color_purple:
+                       case Color_teal:
+                       case Color_violet:
+                               features.require("xcolor");
+                               break;
+                       default:
+                               features.require("color");
+                               break;
+               }
+       }
 }
 
 
index c10ae233dc50b72e6023926bfa259a7e6afacda8..294480a0363ced52715bc7749a4bea9097d7a5d8 100644 (file)
@@ -97,6 +97,8 @@ What's new
 
 - Fix display of Arabic text when compiling with Qt5 (bug 10436).
 
+- Allow using colors supported by xcolor inside mathed (bug 10417).
+
 
 * INTERNALS