diff --git a/src/gfx_layout.h b/src/gfx_layout.h --- a/src/gfx_layout.h +++ b/src/gfx_layout.h @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #ifdef WITH_ICU_LX @@ -155,14 +157,25 @@ class Layouter : public std::vector + bool operator()(const Key1 &lhs, const Key2 &rhs) const { - if (this->state_before.fontsize != other.state_before.fontsize) return this->state_before.fontsize < other.state_before.fontsize; - if (this->state_before.cur_colour != other.state_before.cur_colour) return this->state_before.cur_colour < other.state_before.cur_colour; - if (this->state_before.colour_stack != other.state_before.colour_stack) return this->state_before.colour_stack < other.state_before.colour_stack; - return this->str < other.str; + if (lhs.state_before.fontsize != rhs.state_before.fontsize) return lhs.state_before.fontsize < rhs.state_before.fontsize; + if (lhs.state_before.cur_colour != rhs.state_before.cur_colour) return lhs.state_before.cur_colour < rhs.state_before.cur_colour; + if (lhs.state_before.colour_stack != rhs.state_before.colour_stack) return lhs.state_before.colour_stack < rhs.state_before.colour_stack; + return lhs.str < rhs.str; } }; public: @@ -179,7 +192,7 @@ public: ~LineCacheItem() { delete layout; free(buffer); } }; private: - typedef std::map LineCache; + typedef std::map LineCache; static LineCache *linecache; static LineCacheItem &GetCachedParagraphLayout(const char *str, size_t len, const FontState &state);