Fix Cursor::inCoordCache: the root inset is never in the cache

Fixes bug #10007.
This commit is contained in:
Jean-Marc Lasgouttes 2016-03-11 15:13:05 +01:00
parent bb6130eea1
commit e8e97d67d9

View File

@ -550,8 +550,11 @@ int Cursor::currentMode()
bool Cursor::inCoordCache() const bool Cursor::inCoordCache() const
{ {
// the root inset is not in cache, but we do not need it.
if (depth() == 1)
return true;
CoordCache::Insets const & icache = bv_->coordCache().getInsets(); CoordCache::Insets const & icache = bv_->coordCache().getInsets();
for (size_t i = 0 ; i < depth() ; ++i) for (size_t i = 1 ; i < depth() ; ++i)
if (!icache.has(&(*this)[i].inset())) if (!icache.has(&(*this)[i].inset()))
return false; return false;
return true; return true;