X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FColorCache.h;h=88db6bb565879a7991bb6e59ce1bc29c27927589;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=05dabea4b04e9c0b7316ba61f3ae3de2101dcaa5;hpb=5008ee540f84715cd10e87f3fa0cd5dc7b974784;p=lyx.git diff --git a/src/frontends/qt4/ColorCache.h b/src/frontends/qt4/ColorCache.h index 05dabea4b0..88db6bb565 100644 --- a/src/frontends/qt4/ColorCache.h +++ b/src/frontends/qt4/ColorCache.h @@ -16,32 +16,31 @@ #include -#include - namespace lyx { struct RGBColor; - -// FIXME: use a fixed-size array not a map ? - /** * Cache from Color to QColor. */ -class ColorCache { +class ColorCache +{ public: - ColorCache() {} + ColorCache() : initialized_(false) {} /// get the given color - QColor const & get(Color_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_; }; ///