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.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* 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 {
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
Point::Point(int x, int y)
|
|
|
|
|
: x_(x), y_(y)
|
|
|
|
|
{
|
2008-04-10 21:49:34 +00:00
|
|
|
|
LASSERT(x > -1000000, /**/);
|
|
|
|
|
LASSERT(x < 1000000, /**/);
|
|
|
|
|
LASSERT(y > -1000000, /**/);
|
|
|
|
|
LASSERT(y < 1000000, /**/);
|
2006-10-21 00:16:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
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);
|
2008-04-10 21:49:34 +00:00
|
|
|
|
LASSERT(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
|
|
|
|
|
{
|
2007-11-28 22:12:03 +00:00
|
|
|
|
LYXERR0("InsetCache contains:");
|
2007-04-29 13:39:47 +00:00
|
|
|
|
for (CoordCacheBase<Inset>::cache_type::const_iterator it = getInsets().getData().begin(); it != getInsets().getData().end(); ++it) {
|
|
|
|
|
Inset const * inset = it->first;
|
2007-09-23 22:39:49 +00:00
|
|
|
|
Point const p = it->second.pos;
|
2007-11-28 22:12:03 +00:00
|
|
|
|
LYXERR0("Inset " << inset << "(" << to_utf8(inset->name())
|
|
|
|
|
<< ") 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
|