From bed4cb9684d6d0f600d4d13fb7e44de37f1a2a3d Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 18 Mar 2004 15:49:44 +0000 Subject: [PATCH] fix color nastiness git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8501 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/LColor.C | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6cb26d3160..27132410fc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-03-16 Jean-Marc Lasgouttes + + * LColor.C (getFromLyXName): make sure that the color name is used + as lowercase. 2004-03-17 Angus Leeming * lfuns.h: diff --git a/src/LColor.C b/src/LColor.C index 96e11cad0d..1db6b189db 100644 --- a/src/LColor.C +++ b/src/LColor.C @@ -24,6 +24,7 @@ #include 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(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(pimpl_->infotab.size()), lcname); + } - return static_cast(pimpl_->transform[lyxname]); + return static_cast(pimpl_->transform[lcname]); }