]> git.lyx.org Git - lyx.git/blob - src/coordcache.C
use the default converter for insetexternal, too
[lyx.git] / src / coordcache.C
1
2 #include "coordcache.h"
3 #include "debug.h"
4
5 #include "lyxtext.h"
6
7 #include "mathed/math_data.h"
8 #include "insets/insetbase.h"
9
10 #include <boost/assert.hpp>
11
12
13 CoordCache theCoords;
14
15 // just a helper to be able to set a breakpoint
16 void lyxbreaker(void const * data, const char * hint, int size)
17 {
18         lyxerr << "break on pointer: " << data << " hint: " << hint
19                 << " size: " << size << std::endl;
20         BOOST_ASSERT(false);
21 }
22
23
24 void lyxaborter(int x, int y)
25 {
26         lyxerr << "abort on x: " << x << " y: " << y << std::endl;
27         BOOST_ASSERT(false);
28 }
29
30
31 void CoordCache::clear()
32 {
33         arrays_.clear();
34         insets_.clear();
35         pars_.clear();
36 }
37
38
39 Point CoordCache::get(LyXText const * text, lyx::pit_type pit)
40 {
41         ParPosCache::iterator const it = pars_.find(text);
42         BOOST_ASSERT(it != pars_.end());
43         InnerParPosCache::iterator const posit = it->second.find(pit);
44         BOOST_ASSERT(posit != it->second.end());
45         return posit->second;
46 }