FontList fontlist_;
///
- unsigned int id_;
- ///
- static unsigned int paragraph_id;
+ int id_;
+
///
ParagraphParameters params_;
};
-// Initialization of the counter for the paragraph id's,
-unsigned int Paragraph::Private::paragraph_id = 0;
-
namespace {
struct special_phrase {
Paragraph::Private::Private(Paragraph * owner, Layout const & layout)
- : owner_(owner), inset_owner_(0), begin_of_body_(0), layout_(&layout)
+ : owner_(owner), inset_owner_(0), id_(-1), begin_of_body_(0), layout_(&layout)
{
- id_ = paragraph_id++;
text_.reserve(100);
}
+// Initialization of the counter for the paragraph id's,
+//
+// FIXME: There should be a more intelligent way to generate and use the
+// paragraph ids per buffer instead a global static counter for all InsetText
+// in the running program.
+static int paragraph_id = -1;
+
Paragraph::Private::Private(Private const & p, Paragraph * owner)
: owner_(owner), inset_owner_(p.inset_owner_), fontlist_(p.fontlist_),
params_(p.params_), changes_(p.changes_), insetlist_(p.insetlist_),
begin_of_body_(p.begin_of_body_), text_(p.text_), words_(p.words_),
layout_(p.layout_)
{
- id_ = paragraph_id++;
+ id_ = ++paragraph_id;
}
begin_of_body_(p.begin_of_body_), words_(p.words_),
layout_(p.layout_)
{
- id_ = paragraph_id++;
+ id_ = ++paragraph_id;
if (beg >= pos_type(p.text_.size()))
return;
text_ = p.text_.substr(beg, end - beg);
}
+void Paragraph::setId(int id)
+{
+ d->id_ = id;
+}
+
+
Layout const & Paragraph::layout() const
{
return *d->layout_;