SVN synchronization dialog extended to support SVN-based file comparison

git-svn-id: svn://ultimatepp.org/upp/trunk@1013 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
rylek 2009-03-28 17:17:59 +00:00
parent 8acbaa873b
commit ae247b9ad4
11 changed files with 123 additions and 53 deletions

View file

@ -38,16 +38,19 @@ void TextDiffCtrl::Set(Stream& l, Stream& r)
Vector<String> rl = GetLineMap(r);
Array<TextSection> sections = CompareLineMaps(ll, rl);
Point left_pos = left.GetPos();
Point right_pos = right.GetPos();
int sb_pos = left.GetSb();
// Point left_pos = left.GetPos();
// Point right_pos = right.GetPos();
// int sb_pos = left.GetSb();
int outln = 0;
left.SetCount(0);
right.SetCount(0);
int firstdiff = -1;
for(int i = 0; i < sections.GetCount(); i++) {
const TextSection& sec = sections[i];
bool diff = !sec.same;
if(firstdiff < 0 && diff)
firstdiff = outln;
Color c1 = (diff ? LtBlue() : SBlack()), c2 = (diff ? LtBlue() : SBlack());
int maxcount = max(sec.count1, sec.count2);
left.AddCount(maxcount);
@ -67,6 +70,8 @@ void TextDiffCtrl::Set(Stream& l, Stream& r)
right.Set(outln + l, Null, c2, Null, 2);
outln += maxcount;
}
if(firstdiff >= 0)
left.SetSb(max(firstdiff - 2, 0));
}
void TextDiffCtrl::Set(const String& l, const String& r)