From: Michael Schmitt Date: Sat, 21 Oct 2006 13:47:50 +0000 (+0000) Subject: change tracking: X-Git-Tag: 1.6.10~12274 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=26b0abe7dc2a49b9827c1617e880f5dba7c063ec;p=lyx.git change tracking: * src/changes.h: pass Change and Range to ChangeRange constructor * src/changes.C: adjust git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15448 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/changes.C b/src/changes.C index aaaa3ba1ee..4265e22c52 100644 --- a/src/changes.C +++ b/src/changes.C @@ -110,7 +110,7 @@ void Changes::set(Change const & change, if (it == itend) { lyxerr[Debug::CHANGES] << "Inserting change at end" << endl; - table_.push_back(ChangeRange(start, end, change)); + table_.push_back(ChangeRange(change, Range(start, end))); merge(); return; } @@ -130,7 +130,7 @@ void Changes::set(Change const & change, // split head if (c.range.start < start) { - it = table_.insert(it, ChangeRange(c.range.start, start, c.change)); + it = table_.insert(it, ChangeRange(c.change, Range(c.range.start, start))); if (lyxerr.debugging(Debug::CHANGES)) { lyxerr[Debug::CHANGES] << "Splitting head of type " << c.change.type << " over " << c.range.start << "," << start << endl; @@ -147,7 +147,7 @@ void Changes::set(Change const & change, // split tail if (c.range.end > end) { ++it; - table_.insert(it, ChangeRange(end, c.range.end, c.change)); + table_.insert(it, ChangeRange(c.change, Range(end, c.range.end))); if (lyxerr.debugging(Debug::CHANGES)) { lyxerr[Debug::CHANGES] << "Splitting tail of type " << c.change.type << " over " << end << "," << c.range.end << endl; diff --git a/src/changes.h b/src/changes.h index 8c19627654..8ea506ffd6 100644 --- a/src/changes.h +++ b/src/changes.h @@ -96,10 +96,11 @@ private: class ChangeRange { public: - ChangeRange(pos_type s, pos_type e, Change const & c) - : range(Range(s, e)), change(c) {} - Range range; + ChangeRange(Change const & c, Range const & r) + : change(c), range(r) {} + Change change; + Range range; }; /// merge neighbouring ranges, assuming that they are abutting @@ -107,7 +108,7 @@ private: typedef std::vector ChangeTable; - /// our table of changes, every row a range and change descriptor + /// table of changes, every row a change and range descriptor ChangeTable table_; };