X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FParagraph.h;h=c4d3f9768189992743aa6404885b11547a70bacf;hb=3176ac365ce5bdb85c00d1afc36d7feac2438847;hp=34ea08f64938d5d38fa3a0536639f665d2da7040;hpb=183b188ebe3489aebb372c00818afaab870cf4b8;p=lyx.git diff --git a/src/Paragraph.h b/src/Paragraph.h index 34ea08f649..c4d3f97681 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -76,7 +76,7 @@ public: return first == s.first && last == s.last; } - inline bool inside(pos_type p) const + inline bool contains(pos_type p) const { return first <= p && p <= last; } @@ -90,15 +90,15 @@ public: inline FontSpan intersect(FontSpan const & f) const { FontSpan result = FontSpan(); - if (inside(f.first)) + if (contains(f.first)) result.first = f.first; - else if (f.inside(first)) + else if (f.contains(first)) result.first = first; else return result; - if (inside(f.last)) + if (contains(f.last)) result.last = f.last; - else if (f.inside(last)) + else if (f.contains(last)) result.last = last; return result; } @@ -127,7 +127,8 @@ enum AsStringParameter AS_STR_LABEL = 1, ///< Prefix with paragraph label. AS_STR_INSETS = 2, ///< Go into insets. AS_STR_NEWLINES = 4, ///< Get also newline characters. - AS_STR_SKIPDELETE = 8 ///< Skip deleted text in change tracking. + AS_STR_SKIPDELETE = 8, ///< Skip deleted text in change tracking. + AS_STR_PLAINTEXT = 16 ///< Don't export formatting when descending into insets. }; @@ -173,16 +174,14 @@ public: /// asString(AS_STR_LABEL | AS_STR_INSETS) /// asString(AS_STR_INSETS) docstring asString(int options = AS_STR_NONE) const; - /// + + /// Convert the paragraph to a string. + /// \note If options includes AS_STR_PLAINTEXT, then runparams must be != 0 docstring asString(pos_type beg, pos_type end, - int options = AS_STR_NONE) const; + int options = AS_STR_NONE, + const OutputParams *runparams = 0) const; /// - void forToc(docstring &, size_t maxlen) const; - - /// Extract only the explicitly visible text (without any formatting), - /// descending into insets - docstring stringify(pos_type beg, pos_type end, int options, - OutputParams const & runparams) const; + void forOutliner(docstring &, size_t maxlen) const; /// void write(std::ostream &, BufferParams const &, @@ -377,10 +376,6 @@ public: /// void insertChar(pos_type pos, char_type c, Font const &, Change const & change); - /// Insert \p inset at position \p pos with \p change traking status. - /// \return true if successful. - bool insertInset(pos_type pos, Inset * inset, - Change const & change); /// Insert \p inset at position \p pos with \p change traking status and /// \p font. /// \return true if successful. @@ -409,6 +404,8 @@ public: bool isInset(pos_type pos) const; /// bool isNewline(pos_type pos) const; + /// + bool isEnvSeparator(pos_type pos) const; /// return true if the char is a word separator bool isSeparator(pos_type pos) const; /// @@ -434,8 +431,6 @@ public: /// return true if we allow this par to stay empty bool allowEmpty() const; /// - char_type transformChar(char_type c, pos_type pos) const; - /// ParagraphParameters & params(); /// ParagraphParameters const & params() const;