X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fcoordcache.h;h=dba9b89fd4d283a2a27c7c31e9ecf2dac1a4c379;hb=52eb91c94fb70d58dceef430659c8781de2eccda;hp=4adf25ac39f93facd075707418c19019660db268;hpb=6c300f72a217722652dc27db9108e1050028979c;p=lyx.git diff --git a/src/coordcache.h b/src/coordcache.h index 4adf25ac39..dba9b89fd4 100644 --- a/src/coordcache.h +++ b/src/coordcache.h @@ -45,6 +45,11 @@ public: data_.clear(); } + bool const empty() const + { + return data_.empty(); + } + void add(T const * thing, int x, int y) { data_[thing] = Point(x, y); @@ -90,6 +95,9 @@ private: typedef std::map cache_type; cache_type data_; + +public: + cache_type const & getData() const { return data_; } }; /** @@ -99,13 +107,13 @@ private: * updates. (x,y) == (0,0) is the upper left screen corner, x increases * to the right, y increases downwords. * The cache is built in BufferView::updateMetrics which is called - * from BufferView::Pimpl::update. The individual points are added + * from BufferView::update. The individual points are added * while we paint them. See for instance paintPar in RowPainter.C. */ class CoordCache { public: void clear(); - Point get(LyXText const *, pit_type); + Point get(LyXText const *, pit_type) const; /// A map from paragraph index number to screen point typedef std::map InnerParPosCache;