Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjűnnes wrote:
>> This patch does not feel correct...
>> | -     return (asString(ar) == "none");
>> | +     return (asString(ar) == _("none"));
>>
>> We should never compare with translated strings, Why it is needed
>> here?
>
| Because André passed the gui name of the color to the colorinset, and this 
gui 
| name gets translated. See math_nestinset.C: 396
| if (font.color() != LColor::inherit) {
|               MathAtom at = createMathInset("color");
|               asArray(lcolor.getGUIName(font.color()), at.nucleus()->cell(0));
|               cur.handleNest(at, 1);
|       }
| An alternative is to use the LyX name here instead. LaTeX name is no option, 
| because there is no LColor getFromLaTeXName (and we need the LColor to set 
| the text color).

yes. guiname should only be used when pushing to gui.

>
>> |  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.
>
| There is no other way AFAICS. As stated above, using the LaTeX name directly 
| is no option.

if the above is changed this should not be needed.

>> |       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.
>
| without c_str, I get compiler errors.

Which?

-- 
        Lgb

Reply via email to