]> git.lyx.org Git - features.git/blob - src/frontends/qt2/lcolorcache.C
70bbc6517fe5e8dde1c710c217f393b328aa73cd
[features.git] / src / frontends / qt2 / lcolorcache.C
1 /**
2  * \file lcolorcache.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "lcolorcache.h"
14
15 LColorCache lcolorcache;
16
17
18 LColorCache::LColorCache()
19 {
20 }
21
22
23 QColor const & LColorCache::get(LColor::color col) const
24 {
25         lcolor_map::const_iterator cit = colormap.find(col);
26         if (cit != colormap.end())
27                 return cit->second;
28
29         QColor const qcol(lcolor.getX11Name(col).c_str());
30         colormap[col] = qcol;
31         return colormap[col];
32 }
33
34
35 void LColorCache::clear()
36 {
37         colormap.clear();
38 }