]> git.lyx.org Git - lyx.git/commitdiff
Fix Cursor::inCoordCache: the root inset is never in the cache
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 11 Mar 2016 14:13:05 +0000 (15:13 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 11 Mar 2016 15:55:03 +0000 (16:55 +0100)
Fixes bug #10007.

src/Cursor.cpp

index e9bdf895b7835f18447fa47979552aa705c897b3..8d94ddf5de7e84bc04b9f199b90e59d782287a8b 100644 (file)
@@ -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;