commit e8e97d67d902cbea41aa6425316ece5c2c3b7dc4 Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Fri Mar 11 15:13:05 2016 +0100
Fix Cursor::inCoordCache: the root inset is never in the cache Fixes bug #10007. diff --git a/src/Cursor.cpp b/src/Cursor.cpp index e9bdf89..8d94ddf 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -550,8 +550,11 @@ int Cursor::currentMode() 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(); - for (size_t i = 0 ; i < depth() ; ++i) + for (size_t i = 1 ; i < depth() ; ++i) if (!icache.has(&(*this)[i].inset())) return false; return true;