]> git.lyx.org Git - lyx.git/blobdiff - src/coordcache.h
* Painter.h:
[lyx.git] / src / coordcache.h
index 1b87794afd46bc893ed45fea29c90875ac6ad791..a14751f6f0375ee70c1ca3e077f5b9387b5d9dcc 100644 (file)
 // It seems that MacOSX define the check macro.
 #undef check
 
-class InsetBase;
-class LyXText;
-class MathArray;
-class Paragraph;
-
 #include "support/types.h"
 
-#include <boost/assert.hpp>
-
 #include <map>
 
 namespace lyx {
 
+class InsetBase;
+class LyXText;
+class MathArray;
+class Paragraph;
+
 void lyxbreaker(void const * data, const char * hint, int size);
 
 class Point {
@@ -35,14 +33,7 @@ public:
                : x_(0), y_(0)
        {}
 
-       Point(int x, int y)
-               : x_(x), y_(y)
-       {
-               BOOST_ASSERT(x > -1000000);
-               BOOST_ASSERT(x <  1000000);
-               BOOST_ASSERT(y > -1000000);
-               BOOST_ASSERT(y <  1000000);
-       }
+       Point(int x, int y);
 
        int x_, y_;
 };
@@ -54,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);
@@ -99,6 +95,9 @@ private:
 
        typedef std::map<T const *, Point> cache_type;
        cache_type data_;
+
+public:
+       cache_type const & getData() const { return data_; }
 };
 
 /**
@@ -114,10 +113,10 @@ private:
 class CoordCache {
 public:
        void clear();
-       Point get(LyXText const *, lyx::pit_type);
+       Point get(LyXText const *, pit_type);
 
        /// A map from paragraph index number to screen point
-       typedef std::map<lyx::pit_type, Point> InnerParPosCache;
+       typedef std::map<pit_type, Point> InnerParPosCache;
        /// A map from a LyXText to the map of paragraphs to screen points
        typedef std::map<LyXText const *, InnerParPosCache> ParPosCache;
        /// A map from a CursorSlice to screen points