lyx::pos_type first, last;
};
-
+
/// A Paragraph holds all text, attributes and insets in a text paragraph
class Paragraph {
public:
/// (returning 0) - if this was 0, then we'd
/// try getInset() and crash. We should fix
/// all these places.
- META_INSET = 1
+ //META_INSET = 1 // as in trunk
+ META_INSET = 0x200001 // above 0x10ffff, for ucs-4
+ };
+ enum ChangeTracking
+ {
+ /// Change tracking is "on" in this buffer
+ trackingOn,
+ /// Change tracking is "off" in this buffer
+ trackingOff,
+ /// Change tracking is "unknown" in this buffer
+ trackingUnknown
};
///
- typedef char value_type;
+ typedef lyx::char_type value_type;
///
typedef lyx::depth_type depth_type;
///
LyXFont const & outerfont, std::ostream &,
TexRow & texrow, OutputParams const &) const;
- /// Writes to stream the content of the paragraph for linuxdoc
- void simpleLinuxDocOnePar(Buffer const & buf,
- std::ostream & os,
- LyXFont const & outerfont,
- OutputParams const & runparams,
- lyx::depth_type depth) const;
-
/// Can we drop the standard paragraph wrapper?
bool emptyTag() const;
- /// Get the id of the paragraph, usefull for docbook and linuxdoc
+ /// Get the id of the paragraph, usefull for docbook
std::string getID(Buffer const & buf,
OutputParams const & runparams) const;
void untrackChanges();
/// set entire paragraph to new text for change tracking
- void cleanChanges();
-
- /// look up change type at given pos
- Change::Type lookupChange(lyx::pos_type pos) const;
+ void cleanChanges(ChangeTracking ct = trackingUnknown);
/// look up change at given pos
- Change const lookupChangeFull(lyx::pos_type pos) const;
+ Change const lookupChange(lyx::pos_type pos) const;
/// is there a change within the given range ?
bool isChanged(lyx::pos_type start, lyx::pos_type end) const;
/// is there a non-addition in this range ?
bool isChangeEdited(lyx::pos_type start, lyx::pos_type end) const;
- /// set change at pos
- void setChange(lyx::pos_type pos, Change::Type type);
-
- /// set full change at pos
- void setChangeFull(lyx::pos_type pos, Change change);
+ /// set change type at given pos
+ void setChangeType(lyx::pos_type pos, Change::Type type);
+
+ /// set change at given pos
+ void setChange(lyx::pos_type pos, Change change);
/// accept change
void acceptChange(lyx::pos_type start, lyx::pos_type end);
/// return true if we allow this par to stay empty
bool allowEmpty() const;
///
- unsigned char transformChar(unsigned char c, lyx::pos_type pos) const;
+ lyx::char_type transformChar(lyx::char_type c, lyx::pos_type pos) const;
///
ParagraphParameters & params();
///
RowList const & rows() const { return rows_; }
///
RowSignature & rowSignature() const { return rowSignature_; }
-
+
/// LyXText::redoParagraph updates this
Dimension & dim() { return dim_; }
inline bool isInsertedText(Paragraph const & par, lyx::pos_type pos)
{
- return par.lookupChange(pos) == Change::INSERTED;
+ return par.lookupChange(pos).type == Change::INSERTED;
}
inline bool isDeletedText(Paragraph const & par, lyx::pos_type pos)
{
- return par.lookupChange(pos) == Change::DELETED;
+ return par.lookupChange(pos).type == Change::DELETED;
}
#endif // PARAGRAPH_H