]> git.lyx.org Git - lyx.git/blob - src/CoordCache.cpp
Natbib authoryear uses (Ref1; Ref2) by default.
[lyx.git] / src / CoordCache.cpp
1 /* \file CoordCache.cpp
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
14 #include "Text.h"
15
16 #include "support/debug.h"
17 #include "support/docstring.h"
18
19 #include "insets/Inset.h"
20
21 #include "support/lassert.h"
22
23
24 namespace lyx {
25
26 Point::Point(int x, int y)
27         : x_(x), y_(y)
28 {
29         LASSERT(x > -1000000, x = -1000000);
30         LASSERT(x <  1000000, x =  1000000);
31         LASSERT(y > -1000000, y = -1000000);
32         LASSERT(y <  1000000, y =  1000000);
33 }
34
35
36 // just a helper to be able to set a breakpoint
37 void lyxbreaker(void const * data, const char * hint, int size)
38 {
39         LYXERR0("break on pointer: " << data << " hint: " << hint
40                 << " size: " << size);
41         LASSERT(false, return);
42 }
43
44
45 void CoordCache::clear()
46 {
47         arrays_.clear();
48         insets_.clear();
49 }
50
51
52 void CoordCache::dump() const
53 {
54         LYXERR0("InsetCache contains:");
55         CoordCacheBase<Inset>::cache_type::const_iterator it =
56                 getInsets().data_.begin();
57         for (; it != getInsets().data_.end(); ++it) {
58                 // Warning: it is not guaranteed that inset is a valid pointer
59                 // (therefore it has type 'void *') (see bug #7376).    
60                 void const * inset = it->first;
61                 Point const p = it->second.pos;
62                 LYXERR0("Inset " << inset << " has point " << p.x_ << "," << p.y_);
63         }
64 }
65
66 } // namespace lyx