Juergen Spitzmueller <[EMAIL PROTECTED]> writes: | The color inset might produce latex errors, because it exports the gui name to | LaTeX instead the latex name, and the GUI name string gets translated. > | The attached patch fixes it. I'll apply if I get no objections.
This patch does not feel correct... | Index: math_colorinset.C | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_colorinset.C,v | retrieving revision 1.12 | diff -u -r1.12 math_colorinset.C | --- math_colorinset.C 9 Apr 2005 11:13:21 -0000 1.12 | +++ math_colorinset.C 12 Jun 2005 15:19:02 -0000 | @@ -18,6 +18,8 @@ | #include "LaTeXFeatures.h" | #include "LColor.h" | | +#include "gettext.h" | + | #include "support/std_ostream.h" | | using std::auto_ptr; | @@ -28,7 +30,7 @@ | // color "none" (reset to default) needs special treatment | bool normalcolor(MathArray const & ar) | { | - return (asString(ar) == "none"); | + return (asString(ar) == _("none")); We should never compare with translated strings, Why it is needed here? | void MathColorInset::write(WriteStream & os) const | { | + std::string const color = | + lcolor.getLaTeXName(lcolor.getFromGUIName(asString(cell(0)))); Hmm... seems kindo the wrong way to get the latexname. | if (normalcolor(cell(0))) | os << "{\\normalcolor " << cell(1) << '}'; | else if (oldstyle_) | - os << "{\\color" << '{' << cell(0) << '}' << cell(1) << '}'; | + os << "{\\color" << '{' << color.c_str() << '}' << | cell(1) << '}'; c_str not needed here. | else | - os << "\\textcolor" << '{' << cell(0) << "}{" << cell(1) << '}'; | + os << "\\textcolor" << '{' << color.c_str() << "}{" << cell(1) << '}'; | } nor here. | void MathColorInset::infoize(std::ostream & os) const | { | - os << "Color: " << cell(0); | + os << _("Color") << ": " << asString(cell(0)).c_str(); or here. -- Lgb