]> git.lyx.org Git - lyx.git/commitdiff
Replace outdated LASSERT
authorGeorg Baum <baum@lyx.org>
Wed, 18 Mar 2015 21:06:59 +0000 (22:06 +0100)
committerGeorg Baum <baum@lyx.org>
Fri, 20 Mar 2015 17:50:58 +0000 (18:50 +0100)
The concept of rows and cols is no longer unique to mathed.
Each inset decides itself whether it is grid like or not, so we should not
interfere with this in the cursor slice.

src/CursorSlice.cpp

index e7ef90e8f37c3040e32aead6e0e595344f7a1d84..ae3686fd1ebf9417fc965a46490cfc5f52e09bf2 100644 (file)
@@ -80,19 +80,15 @@ pit_type CursorSlice::lastpit() const
 
 CursorSlice::row_type CursorSlice::row() const
 {
-       // LASSERT: This should only ever be called from an InsetMath.
-       // Should we crash in release mode, though, or try to continue?
-       LASSERT(asInsetMath(), /**/);
-       return asInsetMath()->row(idx_);
+       LASSERT(inset_, return 0);
+       return inset_->row(idx_);
 }
 
 
 CursorSlice::col_type CursorSlice::col() const
 {
-       // LASSERT: This should only ever be called from an InsetMath.
-       // Should we crash in release mode, though, or try to continue?
-       LASSERT(asInsetMath(), /**/);
-       return asInsetMath()->col(idx_);
+       LASSERT(inset_, return 0);
+       return inset_->col(idx_);
 }