CursorSlice const & sl = dit[i];
int xx = 0;
int yy = 0;
- if (sl.inset().editable() == InsetBase::HIGHLY_EDITABLE)
- sl.inset().cursorPos(sl, boundary && ((i+1) == dit.depth()), xx, yy);
+ sl.inset().cursorPos(sl, boundary && ((i+1) == dit.depth()), xx, yy);
x += xx;
y += yy;
//lyxerr << "LCursor::getPos, i: "
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;
string contents;
DocIterator tmpdit = dit;
tmpdit.forwardInset();
+ if (!tmpdit)
+ return false;
if (same_content) {
InsetBase const * inset = tmpdit.nextInset();
} else
return false;
}
-
+
dit = tmpdit;
return true;
}