]> git.lyx.org Git - lyx.git/blob - src/CoordCache.cpp
Provide proper fallback if a bibliography processor is not found
[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 // just a helper to be able to set a breakpoint
27 void lyxbreaker(void const * data, const char * hint, int size)
28 {
29         LYXERR0("break on pointer: " << data << " hint: " << hint
30                 << " size: " << size);
31         LBUFERR(false);
32 }
33
34
35 void CoordCache::clear()
36 {
37         arrays_.clear();
38         insets_.clear();
39 }
40
41
42 void CoordCache::dump() const
43 {
44         if (getInsets().data_.empty()) {
45                 LYXERR0("InsetCache is empty.");
46                 return;
47         }
48
49         LYXERR0("InsetCache contains:");
50         CoordCache::Insets::cache_type::const_iterator it =
51                 getInsets().data_.begin();
52         for (; it != getInsets().data_.end(); ++it) {
53                 // Warning: it is not guaranteed that inset is a valid pointer
54                 // (therefore it has type 'void *') (see bug #7376).
55                 void const * inset = it->first;
56                 Point const p = it->second.pos;
57                 LYXERR0("Inset " << inset << " has point " << p.x_ << "," << p.y_);
58         }
59 }
60
61 } // namespace lyx