#include "mathed/MathData.h"
#include <boost/assert.hpp>
-#include <boost/bind.hpp>
+using std::endl;
-namespace lyx {
-using std::endl;
+namespace lyx {
CursorSlice::CursorSlice()
: inset_(&p), idx_(0), pit_(0), pos_(0)
{
BOOST_ASSERT(inset_);
- inset_->destroyed.connect(
- boost::bind(&CursorSlice::invalidate, this));
-}
-
-
-CursorSlice::CursorSlice(CursorSlice const & cs)
-{
- operator=(cs);
-}
-
-
-CursorSlice & CursorSlice::operator=(CursorSlice const & cs)
-{
- inset_ = cs.inset_;
- idx_ = cs.idx_;
- pit_ = cs.pit_;
- pos_ = cs.pos_;
- if (inset_) {
- BOOST_ASSERT(inset_);
- inset_->destroyed.connect(
- boost::bind(&CursorSlice::invalidate, this));
- }
- return *this;
-}
-
-
-void CursorSlice::invalidate()
-{
- inset_ = 0;
-}
-
-
-bool CursorSlice::isValid() const
-{
- return inset_ != 0;
}
}
+pit_type CursorSlice::lastpit() const
+{
+ if (inset().inMathed())
+ return 0;
+ return text()->paragraphs().size() - 1;
+}
+
+
CursorSlice::row_type CursorSlice::row() const
{
BOOST_ASSERT(asInsetMath());