#include "mathed/math_data.h"
#include "mathed/math_inset.h"
+#include "insets/insettabular.h"
#include <boost/assert.hpp>
#include <boost/current_function.hpp>
}
+InsetBase * DocIterator::realInset() const
+{
+ BOOST_ASSERT(inTexted());
+ // if we are in a tabular, we need the cell
+ if (inset().lyxCode() == InsetBase::TABULAR_CODE) {
+ InsetTabular & tabular = static_cast<InsetTabular&>(inset());
+ return tabular.cell(idx()).get();
+ }
+ return &inset();
+}
+
+
MathAtom const & DocIterator::prevAtom() const
{
BOOST_ASSERT(!empty());
}
-void DocIterator::forwardPos()
+void DocIterator::forwardPos(bool ignorecollapsed)
{
//this dog bites his tail
if (empty()) {
return;
}
+ // jump over collapsables if they are collapsed
+ // FIXME: the check for asMathInset() shouldn't be necessary
+ // but math insets do not return a sensible editable() state yet.
+ if (ignorecollapsed && nextInset() && (!nextInset()->asMathInset()
+ && nextInset()->editable() != InsetBase::HIGHLY_EDITABLE)) {
+ ++top().pos();
+ return;
+ }
+
CursorSlice & tip = top();
//lyxerr << "XXX\n" << *this << endl;
}
-void DocIterator::updateInsets(InsetBase * inset)
+void DocIterator::updateInsets(InsetBase * inset)
{
// this function re-creates the cache of inset pointers.
// code taken in part from StableDocIterator::asDocIterator.
{
return dit1.data_ == dit2.data_;
}
-