]> git.lyx.org Git - lyx.git/commitdiff
change tracking:
authorMichael Schmitt <michael.schmitt@teststep.org>
Sat, 21 Oct 2006 13:47:50 +0000 (13:47 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Sat, 21 Oct 2006 13:47:50 +0000 (13:47 +0000)
* 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

src/changes.C
src/changes.h

index aaaa3ba1ee072e0744316fdc0dd8f2c427d91887..4265e22c52c5c8d4c9271590271f76bb0a080b66 100644 (file)
@@ -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;
index 8c19627654ba090810c64e2ed66aedf15e129b70..8ea506ffd60e64b3904e7fb5216014b836af7b98 100644 (file)
@@ -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<ChangeRange> ChangeTable;
 
-       /// our table of changes, every row a range and change descriptor
+       /// table of changes, every row a change and range descriptor
        ChangeTable table_;
 };