fix color nastiness

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8501 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2004-03-18 15:49:44 +00:00
parent b634b3eb3b
commit bed4cb9684
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2004-03-16 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* LColor.C (getFromLyXName): make sure that the color name is used
as lowercase.
2004-03-17 Angus Leeming <leeming@lyx.org>
* lfuns.h:

View File

@ -24,6 +24,7 @@
#include <map>
using lyx::support::compare_ascii_no_case;
using lyx::support::ascii_lowercase;
using std::endl;
using std::string;
@ -249,10 +250,14 @@ void LColor::addColor(LColor::color c, string const & lyxname) const
LColor::color LColor::getFromLyXName(string const & lyxname) const
{
if (pimpl_->transform.find(lyxname) == pimpl_->transform.end())
addColor(static_cast<color>(pimpl_->infotab.size()), lyxname);
string const lcname = ascii_lowercase(lyxname);
if (pimpl_->transform.find(lcname) == pimpl_->transform.end()) {
lyxerr << "LColor::getFromLyXName: Unknown color \""
<< lyxname << '"' << endl;
addColor(static_cast<color>(pimpl_->infotab.size()), lcname);
}
return static_cast<LColor::color>(pimpl_->transform[lyxname]);
return static_cast<LColor::color>(pimpl_->transform[lcname]);
}