#include "mathed/MathData.h"
#include <boost/assert.hpp>
-#include <boost/bind.hpp>
namespace lyx {
: 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;
}
}
+pit_type CursorSlice::lastpit() const
+{
+ if (inset().inMathed())
+ return 0;
+ return text()->paragraphs().size() - 1;
+}
+
+
CursorSlice::row_type CursorSlice::row() const
{
BOOST_ASSERT(asInsetMath());