X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FDocIterator.h;h=dfef036ae7a01303110d5e433d41db9ff7d97f92;hb=4ba4d701f798488c098ecbc740c3020ed514cd96;hp=117e92383fe71fd5f035aa2ecbd9c80b719f6cf0;hpb=32871c1284f15265f652ff01c438e539a7c8181f;p=lyx.git diff --git a/src/DocIterator.h b/src/DocIterator.h index 117e92383f..dfef036ae7 100644 --- a/src/DocIterator.h +++ b/src/DocIterator.h @@ -20,7 +20,7 @@ namespace lyx { -class LyXText; +class Text; class MathAtom; class Paragraph; @@ -155,20 +155,25 @@ public: // /// 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 @@ -208,6 +213,9 @@ public: 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: @@ -219,6 +227,9 @@ public: 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: /**