Georg Baum a écrit :
Am Montag, 20. März 2006 14:30 schrieb Abdelrazak Younes:
And here is the fix. The problems lies in that the QColor() constructor
produces an invalid color (RGB 0,0,0). I am going to commit that for
qt4. This bug is also present in qt2 but I am not sure the same fix
applies. I have chosen "lightskyblue" as the default color for a branch.
Is it OK?
Conceptually the default color should not be defined in the frontend. I
think that Branch::getColor() should always return a valid color name.
For example the default name could be set in the constructor.
Reading BranchList.C, it seems that the default color is "none". This
doesn't seems like a valid color reading LColor.C:
bool LColor::setColor(LColor::color col, string const & x11name)
{
[...]
// "inherit" is returned for colors not in the database
// (and anyway should not be redefined)
if (col == none || col == inherit || col == ignore) {
lyxerr << "Color " << getLyXName(col)
<< " may not be redefined" << endl;
return false;
}
By the way, is there a reason why Branch stores a string instead of a
LColor? Seems to me like there are a lot of unnecessary conversion.
Branch does not even have a default constructor... is that on purpose?
Abdel.