namespace lyx {
-class LyXText;
+class Text;
class MathAtom;
class Paragraph;
//
/// the paragraph we're in
Paragraph & paragraph();
- /// the paragraph we're in
+ /// the paragraph we're in in text mode.
+ /// \warning only works within text!
Paragraph const & paragraph() const;
+ /// the paragraph we're in in any case.
+ /// This method will give the containing paragraph if
+ /// in not in text mode (ex: in mathed).
+ Paragraph const & innerParagraph() const;
///
- LyXText * text();
+ Text * text();
///
- LyXText const * text() const;
+ Text const * text() const;
/// the containing inset or the cell, respectively
Inset * realInset() const;
///
Inset * innerInsetOfType(int code) const;
///
- LyXText * innerText();
+ Text * innerText();
///
- LyXText const * innerText() const;
+ Text const * innerText() const;
//
// elementary moving
//
- /// move on one logical position, do not descend into nested insets
- void forwardPosNoDescend();
/**
* move on one logical position, descend into nested insets
* skip collapsed insets if \p ignorecollapsed is true
operator<<(std::ostream & os, DocIterator const & cur);
///
friend bool operator==(DocIterator const &, DocIterator const &);
+ friend bool operator<(DocIterator const &, DocIterator const &);
+ friend bool operator>(DocIterator const &, DocIterator const &);
+ friend bool operator<=(DocIterator const &, DocIterator const &);
///
friend class StableDocIterator;
//protected:
void pop_back() { slices_.pop_back(); }
/// recompute the inset parts of the cursor from the document data
void updateInsets(Inset * inset);
+ /// fix DocIterator in circumstances that should never happen.
+ /// \return true if the DocIterator was fixed.
+ bool fixIfBroken();
private:
/**