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-11-14 21:57:43 +00:00
|
|
|
|
#include "debug.h"
|
2007-04-29 23:33:02 +00:00
|
|
|
|
#include "Text.h"
|
2004-11-30 01:59:49 +00:00
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
#include <boost/assert.hpp>
|
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)
|
|
|
|
|
{
|
|
|
|
|
BOOST_ASSERT(x > -1000000);
|
|
|
|
|
BOOST_ASSERT(x < 1000000);
|
|
|
|
|
BOOST_ASSERT(y > -1000000);
|
|
|
|
|
BOOST_ASSERT(y < 1000000);
|
|
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
2004-10-05 10:11:42 +00:00
|
|
|
|
lyxerr << "break on pointer: " << data << " hint: " << hint
|
2004-08-14 14:04:37 +00:00
|
|
|
|
<< " size: " << size << std::endl;
|
2004-11-30 01:59:49 +00:00
|
|
|
|
BOOST_ASSERT(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
{
|
2006-10-21 10:56:36 +00:00
|
|
|
|
lyxerr << "InsetCache contains:" << std::endl;
|
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-04-30 14:39:09 +00:00
|
|
|
|
lyxerr << "Inset " << inset << "(" << to_utf8(inset->name())
|
2007-04-29 13:39:47 +00:00
|
|
|
|
<< ") has point " << p.x_ << "," << p.y_ << std::endl;
|
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
|