(getGCLinepars): only lookup in the linecache once.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3169 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-12-08 03:27:31 +00:00
parent 19d9667015
commit dd51f5a487
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@
* ColorHandler.C (updateColor): change the hash to cover the whole
LColor enum, ws cleanup
(getGCLinepars): ditto
(getGCLinepars): only lookup in the linecache once.
2001-12-07 Dekel Tsur <dekelts@tau.ac.il>

View File

@ -172,8 +172,9 @@ GC LyXColorHandler::getGCLinepars(PainterBase::line_style ls,
int index = lw + (ls << 1) + (c << 6);
if (lineGCcache.find(index) != lineGCcache.end())
return lineGCcache[index];
LineGCCache::iterator it = lineGCcache.find(index);
if (it != lineGCcache.end())
return it->second;
XGCValues val;
XGetGCValues(display, getGCForeground(c), GCForeground, &val);