]> git.lyx.org Git - lyx.git/blob - src/CoordCache.cpp
Avoid full metrics computation with Update:FitCursor
[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
15 #include "support/debug.h"
16
17 #include "support/lassert.h"
18
19
20 namespace lyx {
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         LYXERR0("break on pointer: " << data << " hint: " << hint
26                 << " size: " << size);
27         LBUFERR(false);
28 }
29
30
31 void CoordCache::clear()
32 {
33         arrays_.clear();
34         insets_.clear();
35 }
36
37
38 void CoordCache::dump() const
39 {
40         if (getInsets().data_.empty()) {
41                 LYXERR0("InsetCache is empty.");
42                 return;
43         }
44
45         LYXERR0("InsetCache contains:");
46         for (auto const & ccd : getInsets().data_) {
47                 // Warning: it is not guaranteed that inset is a valid pointer
48                 // (therefore it has type 'void *') (see bug #7376).
49                 void const * inset = ccd.first;
50                 Point const p = ccd.second.pos;
51                 LYXERR(Debug::PAINTING, "Inset " << inset << " has point " << p.x_ << "," << p.y_);
52         }
53 }
54
55 } // namespace lyx