]> git.lyx.org Git - lyx.git/blobdiff - src/CursorSlice.cpp
* Only enter inset which return true on isActive(). This is the behavior in the curso...
[lyx.git] / src / CursorSlice.cpp
index 2b1164e99d69f963e54e92621d77f24a93b5526a..710f65c80419c0e2623700c66b8ce7c0feebb961 100644 (file)
@@ -25,7 +25,6 @@
 #include "mathed/MathData.h"
 
 #include <boost/assert.hpp>
-#include <boost/bind.hpp>
 
 
 namespace lyx {
@@ -42,36 +41,6 @@ CursorSlice::CursorSlice(Inset & p)
        : inset_(&p), idx_(0), pit_(0), pos_(0)
 {
        BOOST_ASSERT(inset_);
-       boost::signal<void()> * destroyed_signal = inset_->destroyedSignal();
-       if (destroyed_signal)
-               inset_connection_ = destroyed_signal->connect(
-                       boost::bind(&CursorSlice::invalidate, this));
-}
-
-
-CursorSlice::CursorSlice(CursorSlice const & cs)
-{
-       operator=(cs);
-}
-
-
-CursorSlice::~CursorSlice()
-{
-       inset_connection_.disconnect();
-}
-
-
-CursorSlice & CursorSlice::operator=(CursorSlice const & cs)
-{
-       inset_ = cs.inset_;
-       idx_ = cs.idx_;
-       pit_ = cs.pit_;
-       pos_ = cs.pos_;
-       if (inset_ && inset_->destroyedSignal()) {
-               inset_connection_ = inset_->destroyedSignal()->connect(
-                       boost::bind(&CursorSlice::invalidate, this));
-       }
-       return *this;
 }
 
 
@@ -112,6 +81,14 @@ pos_type CursorSlice::lastpos() const
 }
 
 
+pit_type CursorSlice::lastpit() const
+{
+       if (inset().inMathed())
+               return 0;
+       return text()->paragraphs().size() - 1;
+}
+
+
 CursorSlice::row_type CursorSlice::row() const
 {
        BOOST_ASSERT(asInsetMath());