]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/lcolorcache.C
Martin's changes to the Note inset.
[lyx.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 "lcolorcache.h"
12
13 LColorCache lcolorcache;
14
15
16 LColorCache::LColorCache()
17 {
18 }
19
20
21 QColor const & LColorCache::get(LColor::color col) const
22 {
23         lcolor_map::const_iterator cit = colormap.find(col);
24         if (cit != colormap.end())
25                 return cit->second;
26
27         QColor const qcol(lcolor.getX11Name(col).c_str());
28         colormap[col] = qcol;
29         return colormap[col];
30 }
31
32
33 void LColorCache::clear()
34 {
35         colormap.clear();
36 }