]> git.lyx.org Git - lyx.git/commitdiff
* CursorSlice::lastpos(): check for text emptiness (should fix a crash when releasing...
authorAbdelrazak Younes <younes@lyx.org>
Thu, 10 Jan 2008 08:46:04 +0000 (08:46 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 10 Jan 2008 08:46:04 +0000 (08:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22474 a592a061-630c-0410-9148-cb99ea01b6c8

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());
 }