#pragma interface
#endif
+//#define HAVE_ROPE 1
+
+#ifdef HAVE_ROPE
+#include <rope>
+#endif
+
#include <vector>
#include <list>
///
typedef char value_type;
///
+#ifndef HAVE_ROPE
typedef std::vector<value_type> TextContainer;
+#else
+ typedef std::rope<value_type> TextContainer;
+#endif
///
- typedef int size_type;
+ /* This should be TextContainer::size_type, but we need
+ signed values for now.
+ */
+ typedef TextContainer::difference_type size_type;
///
LyXParagraph();
- /// this konstruktor inserts the new paragraph in a list
+ /// this constructor inserts the new paragraph in a list
explicit
LyXParagraph(LyXParagraph * par);
- /// the destruktors removes the new paragraph from the list
+ /// the destructor removes the new paragraph from the list
~LyXParagraph();
///
size_type size() const { return text.size(); }
///
void fitToSize() {
+#ifndef HAVE_ROPE
text.resize(text.size());
+#endif
}
///
void setContentsFromPar(LyXParagraph * par) {
}
///
void clearContents() {
+#ifndef HAVE_ROPE
text.clear();
+#else
+ text.erase(text.mutable_begin(), text.mutable_end());
+#endif
}
///
value_type GetChar(size_type pos) const;
/// The position must already exist.
void SetChar(size_type pos, value_type c) {
+#ifndef HAVE_ROPE
text[pos] = c;
+#else
+ text.replace(pos, c);
+#endif
}
///
///
void CloseFootnote(size_type pos);
#endif
- /// important for cut and paste
- void CopyIntoMinibuffer(BufferParams const &, size_type pos) const;
+ /** important for cut and paste
+ Temporary change from BufferParams to Buffer. Will revert when we
+ get rid of the argument to Inset::Clone(Buffer const &) */
+ void CopyIntoMinibuffer(Buffer const &, size_type pos) const;
///
void CutIntoMinibuffer(BufferParams const &, size_type pos);
///