X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraph.cpp;h=233057e9163ad9058363f378066dbef466f92de7;hb=2098f1d8c20d51e63e670bcdc9da8996068975bf;hp=bfaec69d14f825f5c269d3fbcede6cf3049a7060;hpb=744ee152faeb376a142d26c09784d1a7e9dd303d;p=lyx.git diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index bfaec69d14..233057e916 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -242,12 +242,20 @@ Paragraph::Private::Private(Paragraph * owner, Layout const & layout) } +// 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_), - id_(p.id_), params_(p.params_), changes_(p.changes_), insetlist_(p.insetlist_), + 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; } @@ -259,6 +267,7 @@ Paragraph::Private::Private(Private const & p, Paragraph * owner, begin_of_body_(p.begin_of_body_), words_(p.words_), layout_(p.layout_) { + id_ = ++paragraph_id; if (beg >= pos_type(p.text_.size())) return; text_ = p.text_.substr(beg, end - beg);