X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FColorCache.h;h=88db6bb565879a7991bb6e59ce1bc29c27927589;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=0404a8a81f58dfd6fcb8c667934f216acc6bb668;hpb=10d5ea0d8a28c9da3344f73ac860215b89b76e22;p=lyx.git diff --git a/src/frontends/qt4/ColorCache.h b/src/frontends/qt4/ColorCache.h index 0404a8a81f..88db6bb565 100644 --- a/src/frontends/qt4/ColorCache.h +++ b/src/frontends/qt4/ColorCache.h @@ -12,38 +12,40 @@ #ifndef COLORCACHE_H #define COLORCACHE_H -#include "LColor.h" +#include "Color.h" #include -#include - namespace lyx { -struct RGBColor; -} - -// FIXME: use a fixed-size array not a map ? +struct RGBColor; /** - * Cache from LColor to QColor. + * Cache from Color to QColor. */ -class ColorCache { +class ColorCache +{ public: - ColorCache(); + ColorCache() : initialized_(false) {} /// get the given color - QColor const & get(LColor_color color) const; + QColor get(Color color) const; /// clear all colors - void clear(); + void clear() { initialized_ = false; } private: - typedef std::map lcolor_map; - - mutable lcolor_map colormap; + /// + void init(); + /// + QColor lcolors_[Color_ignore + 1]; + /// + bool initialized_; }; /// -QColor const rgb2qcolor(lyx::RGBColor const &); +QColor const rgb2qcolor(RGBColor const &); + +} // namespace lyx + #endif // COLORCACHE_H