]> git.lyx.org Git - lyx.git/blobdiff - src/CursorSlice.cpp
compil fix for Qt-4.2
[lyx.git] / src / CursorSlice.cpp
index 3f52df8b3faabf2c3a21490fd03874d5900401b2..af6d97894793e0e853e803d17f9aca8930d71a53 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <ostream>
 
+using namespace std;
 
 namespace lyx {
 
@@ -60,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());
 }
 
 
@@ -205,7 +207,7 @@ bool operator<=(CursorSlice const & p, CursorSlice const & q)
 }
 
 
-std::ostream & operator<<(std::ostream & os, CursorSlice const & item)
+ostream & operator<<(ostream & os, CursorSlice const & item)
 {
        return os
           << "inset: " << (void *)&item.inset()