Point getPos(DocIterator const & dit, bool boundary)
{
CursorSlice const & bot = dit.bottom();
- CoordCache::InnerParPosCache const & cache =
- theCoords.getParPos().find(bot.text())->second;
+ CoordCache::ParPosCache::const_iterator cache_it =
+ theCoords.getParPos().find(bot.text());
+ if (cache_it == theCoords.getParPos().end())
+ return Point(-1, -1);
+
+ CoordCache::InnerParPosCache const & cache = cache_it->second;
CoordCache::InnerParPosCache::const_iterator it = cache.find(bot.pit());
if (it == cache.end()) {
//lyxerr << "cursor out of view" << std::endl;
static PainterInfo nullpi(pi.base.bv, nop);
int const ww = pi.base.bv->workHeight();
+ theCoords.parPos()[&text][pit] = Point(x, y);
+
Paragraph const & par = text.paragraphs()[pit];
+ if (par.rows().empty())
+ return;
RowList::const_iterator const rb = par.rows().begin();
RowList::const_iterator const re = par.rows().end();
- theCoords.parPos()[&text][pit] = Point(x, y);
y -= rb->ascent();
lyx::size_type rowno(0);
{
//lyxerr << "LyXText::cursorY: boundary: " << boundary << std::endl;
Paragraph const & par = getPar(sl.pit());
+ if (par.rows().empty())
+ return 0;
+
int h = 0;
h -= pars_[0].rows()[0].ascent();
for (pit_type pit = 0; pit < sl.pit(); ++pit)