Make flip in ChangeSet move two different-length strings around.

Instead of just flipping same-length strings.
Also fix an incorrect replace position adjustment.
This commit is contained in:
Christian Kamm
2009-11-26 14:42:19 +01:00
parent 36913baf94
commit 746bea8e1e
3 changed files with 61 additions and 44 deletions

View File

@@ -66,13 +66,14 @@ public:
Copy
};
EditOp(): type(Unset), pos1(0), pos2(0), length(0) {}
EditOp(Type t): type(t), pos1(0), pos2(0), length(0) {}
EditOp(): type(Unset), pos1(0), pos2(0), length1(0), length2(0) {}
EditOp(Type t): type(t), pos1(0), pos2(0), length1(0), length2(0) {}
Type type;
int pos1;
int pos2;
int length;
int length1;
int length2;
QString text;
};
@@ -89,7 +90,7 @@ public:
bool move(int pos, int length, int to);
bool insert(int pos, const QString &text);
bool remove(int pos, int length);
bool flip(int pos1, int length, int pos2);
bool flip(int pos1, int length1, int pos2, int length2);
bool copy(int pos, int length, int to);
bool hadErrors();