* DocIterator::prevInset(): return 0 if the mathed cell() is empty.
* LCursor::info(): use prevInset() only if different from zero.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17104
a592a061-630c-0410-9148-
cb99ea01b6c8
}
+void LCursor::setSelection(DocIterator const & from,
+ DocIterator const & to)
+{
+ setCursor(to);
+ selection() = true;
+ anchor_ = from;
+}
+
+
void LCursor::clearSelection()
{
selection() = false;
operator[](i).inset().infoize(os);
os << " ";
}
- if (pos() != 0)
- prevInset()->infoize2(os);
+ if (pos() != 0) {
+ InsetBase const * inset = prevInset();
+ // prevInset() can return 0 in certain case.
+ if (inset)
+ prevInset()->infoize2(os);
+ }
// overwite old message
os << " ";
}
if (pos() == 0)
return 0;
if (inMathed())
- return prevAtom().nucleus();
+ if (cell().empty())
+ // FIXME: this should not happen but it does.
+ // See bug 3189
+ // http://bugzilla.lyx.org/show_bug.cgi?id=3189
+ return 0;
+ else
+ return prevAtom().nucleus();
return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
}
if (pos() == 0)
return 0;
if (inMathed())
- return prevAtom().nucleus();
+ if (cell().empty())
+ // FIXME: this should not happen but it does.
+ // See bug 3189
+ // http://bugzilla.lyx.org/show_bug.cgi?id=3189
+ return 0;
+ else
+ return prevAtom().nucleus();
return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0;
}