]> git.lyx.org Git - lyx.git/blobdiff - src/CursorSlice.cpp
* CursorSlice::lastpos(): check for text emptiness (should fix a crash when releasing...
[lyx.git] / src / CursorSlice.cpp
index f4319dcf01532da242081211ae6a7a0ad2187f10..af6d97894793e0e853e803d17f9aca8930d71a53 100644 (file)
@@ -61,7 +61,8 @@ Paragraph & CursorSlice::paragraph() const
 pos_type CursorSlice::lastpos() const
 {
        BOOST_ASSERT(inset_);
-       return inset_->asInsetMath() ? cell().size() : paragraph().size();
+       return inset_->asInsetMath() ? cell().size() 
+               : (text()->empty() ? 0 : paragraph().size());
 }