]> git.lyx.org Git - lyx.git/blob - src/coordcache.C
262aaa7d8a7ff9b687b707f53f1d97840265aea5
[lyx.git] / src / coordcache.C
1 /* \file coordcache.C
2  * This file is part of LyX, the document processor.
3  * Licence details can be found in the file COPYING.
4  *
5  * \author André Pönitz
6  *
7  * Full author contact details are available in file CREDITS.
8  */
9
10 #include <config.h>
11
12 #include "coordcache.h"
13 #include "debug.h"
14
15 #include "lyxtext.h"
16
17 #include "insets/insetbase.h"
18
19 #include <boost/assert.hpp>
20
21
22 // just a helper to be able to set a breakpoint
23 void lyxbreaker(void const * data, const char * hint, int size)
24 {
25         lyxerr << "break on pointer: " << data << " hint: " << hint
26                 << " size: " << size << std::endl;
27         BOOST_ASSERT(false);
28 }
29
30
31 void CoordCache::clear()
32 {
33         arrays_.clear();
34         insets_.clear();
35         pars_.clear();
36         slices0_.clear();
37         slices1_.clear();
38 }
39
40
41 Point CoordCache::get(LyXText const * text, lyx::pit_type pit)
42 {
43         ParPosCache::iterator const it = pars_.find(text);
44         BOOST_ASSERT(it != pars_.end());
45         InnerParPosCache::iterator const posit = it->second.find(pit);
46         BOOST_ASSERT(posit != it->second.end());
47         return posit->second;
48 }