]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathNest.C
This commit fixes a crash when accessing a math inset. This was due to an invalid...
[features.git] / src / mathed / InsetMathNest.C
index e0e3e419a2efdbb88f84621a697897e2c1cfa895..37db10add0045cf1b2e5409ef9bbae070c74a1ab 100644 (file)
@@ -98,8 +98,9 @@ MathArray const & InsetMathNest::cell(idx_type i) const
 }
 
 
-void InsetMathNest::cursorPos(CursorSlice const & sl, bool /*boundary*/,
-       int & x, int & y) const
+void InsetMathNest::cursorPos(BufferView const & bv,
+               CursorSlice const & sl, bool /*boundary*/,
+               int & x, int & y) const
 {
 // FIXME: This is a hack. Ideally, the coord cache should not store
 // absolute positions, but relative ones. This would mean to call
@@ -110,7 +111,7 @@ void InsetMathNest::cursorPos(CursorSlice const & sl, bool /*boundary*/,
 // absolute again when actually drawing the cursor. What a mess.
        BOOST_ASSERT(ptr_cmp(&sl.inset(), this));
        MathArray const & ar = sl.cell();
-       CoordCache & coord_cache = sl.text()->bv()->coordCache();
+       CoordCache const & coord_cache = bv.coordCache();
        if (!coord_cache.getArrays().has(&ar)) {
                // this can (semi-)legally happen if we just created this cell
                // and it never has been drawn before. So don't ASSERT.