2007-04-26 04:41:58 +00:00
|
|
|
/* \file CoordCache.cpp
|
2005-04-26 10:30:24 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2005-04-26 10:30:24 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
2004-08-14 14:04:37 +00:00
|
|
|
|
2007-04-26 04:41:58 +00:00
|
|
|
#include "CoordCache.h"
|
2004-08-14 14:04:37 +00:00
|
|
|
|
2007-04-29 23:33:02 +00:00
|
|
|
#include "Text.h"
|
2004-11-30 01:59:49 +00:00
|
|
|
|
2007-11-29 07:04:28 +00:00
|
|
|
#include "support/debug.h"
|
2007-11-14 21:57:43 +00:00
|
|
|
#include "support/docstring.h"
|
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
#include "insets/Inset.h"
|
2004-11-30 01:59:49 +00:00
|
|
|
|
2008-04-30 08:26:40 +00:00
|
|
|
#include "support/lassert.h"
|
2004-08-14 14:04:37 +00:00
|
|
|
|
2004-11-30 01:59:49 +00:00
|
|
|
|
2006-10-15 22:32:56 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2004-08-14 14:04:37 +00:00
|
|
|
// just a helper to be able to set a breakpoint
|
|
|
|
void lyxbreaker(void const * data, const char * hint, int size)
|
|
|
|
{
|
2007-11-28 22:12:03 +00:00
|
|
|
LYXERR0("break on pointer: " << data << " hint: " << hint
|
|
|
|
<< " size: " << size);
|
2014-03-28 18:47:54 +00:00
|
|
|
LBUFERR(false);
|
2004-11-30 01:59:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-10-05 10:11:42 +00:00
|
|
|
void CoordCache::clear()
|
2004-08-14 14:04:37 +00:00
|
|
|
{
|
|
|
|
arrays_.clear();
|
|
|
|
insets_.clear();
|
|
|
|
}
|
|
|
|
|
2005-07-16 17:54:25 +00:00
|
|
|
|
2007-04-29 12:32:14 +00:00
|
|
|
void CoordCache::dump() const
|
|
|
|
{
|
2015-11-20 21:43:45 +00:00
|
|
|
if (getInsets().data_.empty()) {
|
|
|
|
LYXERR0("InsetCache is empty.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-11-28 22:12:03 +00:00
|
|
|
LYXERR0("InsetCache contains:");
|
2020-02-28 06:44:48 +00:00
|
|
|
for (auto const & ccd : getInsets().data_) {
|
2011-03-23 16:25:43 +00:00
|
|
|
// Warning: it is not guaranteed that inset is a valid pointer
|
2015-11-20 21:43:45 +00:00
|
|
|
// (therefore it has type 'void *') (see bug #7376).
|
2020-02-28 06:44:48 +00:00
|
|
|
void const * inset = ccd.first;
|
|
|
|
Point const p = ccd.second.pos;
|
2011-03-23 16:25:43 +00:00
|
|
|
LYXERR0("Inset " << inset << " has point " << p.x_ << "," << p.y_);
|
2006-10-21 10:56:36 +00:00
|
|
|
}
|
2006-10-20 20:57:21 +00:00
|
|
|
}
|
|
|
|
|
2006-10-15 22:32:56 +00:00
|
|
|
} // namespace lyx
|