]> git.lyx.org Git - features.git/commitdiff
Revert part of r32766. This was a stupid change as newer paragraph
authorAbdelrazak Younes <younes@lyx.org>
Wed, 6 Jan 2010 09:12:49 +0000 (09:12 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 6 Jan 2010 09:12:49 +0000 (09:12 +0000)
weren't taken into account. So the paragraph id management is now going
back to Paragraph.cpp.

Sorry for the trouble.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32788 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp
src/Text.cpp

index bfaec69d14f825f5c269d3fbcede6cf3049a7060..233057e9163ad9058363f378066dbef466f92de7 100644 (file)
@@ -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);
index 66c6090aa22c9abb40d8d9561fcdf82ddb7cbcb2..c5d1501417853a8f00df2b75b9138147f5af731a 100644 (file)
@@ -170,19 +170,12 @@ void mergeParagraph(BufferParams const & bparams,
        pars.erase(boost::next(pars.begin(), par_offset + 1));
 }
 
-// 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;
 
 Text::Text(InsetText * owner, bool use_default_layout)
        : owner_(owner), autoBreakRows_(false), undo_counter_(0)
 {
        pars_.push_back(Paragraph());
        Paragraph & par = pars_.back();
-       par.setId(++paragraph_id);
        par.setInsetOwner(owner);
        DocumentClass const & dc = owner->buffer().params().documentClass();
        if (use_default_layout)
@@ -198,10 +191,8 @@ Text::Text(InsetText * owner, Text const & text)
        pars_ = text.pars_;
        ParagraphList::iterator const end = pars_.end();
        ParagraphList::iterator it = pars_.begin();
-       for (; it != end; ++it) {
-               it->setId(++paragraph_id);
+       for (; it != end; ++it)
                it->setInsetOwner(owner);
-       }
 }