X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraph.h;h=c4d3f9768189992743aa6404885b11547a70bacf;hb=dae8555234f0e5c8358b91c307d91b219c664617;hp=955804871b2e04eb159d06000cc47bf767c70c0f;hpb=30f518707009150cbe6ef13d717d535b61f584df;p=lyx.git diff --git a/src/Paragraph.h b/src/Paragraph.h index 955804871b..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 &, @@ -405,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; /// @@ -430,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;