]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / cursor.C
index bae6adc85f918c0c555facecb61bcff68c70341b..d77f7c25c918735a8a0a0390eaa6e4ecca31088f 100644 (file)
@@ -507,13 +507,24 @@ std::ostream & operator<<(std::ostream & os, LCursor const & cur)
 
 bool LCursor::isInside(InsetBase const * p)
 {
-       for (unsigned i = 0; i < depth(); ++i)
+       for (size_t i = 0; i != depth(); ++i)
                if (&operator[](i).inset() == p)
                        return true;
        return false;
 }
 
 
+void LCursor::leaveInset(InsetBase const & inset)
+{
+       for (size_t i = 0; i != depth(); ++i) {
+               if (&operator[](i).inset() == &inset) {
+                       resize(i);
+                       return;
+               }
+       }
+}
+
+
 bool LCursor::openable(MathAtom const & t) const
 {
        if (!t->isActive())