Commit 291436ec authored by Michael Reeves's avatar Michael Reeves

Make LineRefs private in Diff3line

parent 0cfd107b
...@@ -126,16 +126,16 @@ void calcDiff3LineListUsingAB( ...@@ -126,16 +126,16 @@ void calcDiff3LineListUsingAB(
if(d.nofEquals > 0) if(d.nofEquals > 0)
{ {
d3l.bAEqB = true; d3l.bAEqB = true;
d3l.lineA = lineA; d3l.setLineA(lineA);
d3l.lineB = lineB; d3l.setLineB(lineB);
--d.nofEquals; --d.nofEquals;
++lineA; ++lineA;
++lineB; ++lineB;
} }
else if(d.diff1 > 0 && d.diff2 > 0) else if(d.diff1 > 0 && d.diff2 > 0)
{ {
d3l.lineA = lineA; d3l.setLineA(lineA);
d3l.lineB = lineB; d3l.setLineB(lineB);
--d.diff1; --d.diff1;
--d.diff2; --d.diff2;
++lineA; ++lineA;
...@@ -143,13 +143,13 @@ void calcDiff3LineListUsingAB( ...@@ -143,13 +143,13 @@ void calcDiff3LineListUsingAB(
} }
else if(d.diff1 > 0) else if(d.diff1 > 0)
{ {
d3l.lineA = lineA; d3l.setLineA(lineA);
--d.diff1; --d.diff1;
++lineA; ++lineA;
} }
else if(d.diff2 > 0) else if(d.diff2 > 0)
{ {
d3l.lineB = lineB; d3l.setLineB(lineB);
--d.diff2; --d.diff2;
++lineB; ++lineB;
} }
...@@ -191,10 +191,10 @@ void calcDiff3LineListUsingAC( ...@@ -191,10 +191,10 @@ void calcDiff3LineListUsingAC(
if(d.nofEquals > 0) if(d.nofEquals > 0)
{ {
// Find the corresponding lineA // Find the corresponding lineA
while((*i3).lineA != lineA) while((*i3).getLineA() != lineA)
++i3; ++i3;
(*i3).lineC = lineC; (*i3).setLineC(lineC);
(*i3).bAEqC = true; (*i3).bAEqC = true;
(*i3).bBEqC = (*i3).bAEqB; (*i3).bBEqC = (*i3).bAEqB;
...@@ -205,7 +205,7 @@ void calcDiff3LineListUsingAC( ...@@ -205,7 +205,7 @@ void calcDiff3LineListUsingAC(
} }
else if(d.diff1 > 0 && d.diff2 > 0) else if(d.diff1 > 0 && d.diff2 > 0)
{ {
d3l.lineC = lineC; d3l.setLineC(lineC);
d3ll.insert(i3, d3l); d3ll.insert(i3, d3l);
--d.diff1; --d.diff1;
--d.diff2; --d.diff2;
...@@ -219,7 +219,7 @@ void calcDiff3LineListUsingAC( ...@@ -219,7 +219,7 @@ void calcDiff3LineListUsingAC(
} }
else if(d.diff2 > 0) else if(d.diff2 > 0)
{ {
d3l.lineC = lineC; d3l.setLineC(lineC);
d3ll.insert(i3, d3l); d3ll.insert(i3, d3l);
--d.diff2; --d.diff2;
++lineC; ++lineC;
...@@ -263,10 +263,10 @@ void calcDiff3LineListUsingBC( ...@@ -263,10 +263,10 @@ void calcDiff3LineListUsingBC(
if(d.nofEquals > 0) if(d.nofEquals > 0)
{ {
// Find the corresponding lineB and lineC // Find the corresponding lineB and lineC
while(i3b != d3ll.end() && (*i3b).lineB != lineB) while(i3b != d3ll.end() && (*i3b).getLineB() != lineB)
++i3b; ++i3b;
while(i3c != d3ll.end() && (*i3c).lineC != lineC) while(i3c != d3ll.end() && (*i3c).getLineC() != lineC)
++i3c; ++i3c;
Q_ASSERT(i3b != d3ll.end()); Q_ASSERT(i3b != d3ll.end());
...@@ -274,7 +274,7 @@ void calcDiff3LineListUsingBC( ...@@ -274,7 +274,7 @@ void calcDiff3LineListUsingBC(
if(i3b == i3c) if(i3b == i3c)
{ {
Q_ASSERT((*i3b).lineC == lineC); Q_ASSERT((*i3b).getLineC() == lineC);
(*i3b).bBEqC = true; (*i3b).bBEqC = true;
} }
else else
...@@ -298,7 +298,7 @@ void calcDiff3LineListUsingBC( ...@@ -298,7 +298,7 @@ void calcDiff3LineListUsingBC(
int nofDisturbingLines = 0; int nofDisturbingLines = 0;
while(i3 != i3b && i3 != d3ll.end()) while(i3 != i3b && i3 != d3ll.end())
{ {
if((*i3).lineB != -1) if((*i3).getLineB() != -1)
++nofDisturbingLines; ++nofDisturbingLines;
++i3; ++i3;
} }
...@@ -327,18 +327,18 @@ void calcDiff3LineListUsingBC( ...@@ -327,18 +327,18 @@ void calcDiff3LineListUsingBC(
i3 = i3c; i3 = i3c;
while(i3 != i3b) while(i3 != i3b)
{ {
if((*i3).lineB != -1 || if((*i3).getLineB() != -1 ||
(before_or_on_equal_line_in_A && i3->lineA != -1)) (before_or_on_equal_line_in_A && i3->getLineA() != -1))
{ {
d3l.lineB = (*i3).lineB; d3l.setLineB((*i3).getLineB());
(*i3).lineB = -1; (*i3).setLineB(-1);
// Move A along if it matched B // Move A along if it matched B
if(before_or_on_equal_line_in_A) if(before_or_on_equal_line_in_A)
{ {
d3l.lineA = i3->lineA; d3l.setLineA(i3->getLineA());
d3l.bAEqB = i3->bAEqB; d3l.bAEqB = i3->bAEqB;
i3->lineA = -1; i3->setLineA(-1);
i3->bAEqC = false; i3->bAEqC = false;
} }
...@@ -360,10 +360,10 @@ void calcDiff3LineListUsingBC( ...@@ -360,10 +360,10 @@ void calcDiff3LineListUsingBC(
if(nofDisturbingLines == 0) if(nofDisturbingLines == 0)
{ {
// Yes, the line from B can be moved. // Yes, the line from B can be moved.
(*i3b).lineB = -1; // This might leave an empty line: removed later. (*i3b).setLineB(-1); // This might leave an empty line: removed later.
(*i3b).bAEqB = false; (*i3b).bAEqB = false;
(*i3b).bBEqC = false; (*i3b).bBEqC = false;
(*i3c).lineB = lineB; (*i3c).setLineB(lineB);
(*i3c).bBEqC = true; (*i3c).bBEqC = true;
(*i3c).bAEqB = (*i3c).bAEqC; (*i3c).bAEqB = (*i3c).bAEqC;
} }
...@@ -374,7 +374,7 @@ void calcDiff3LineListUsingBC( ...@@ -374,7 +374,7 @@ void calcDiff3LineListUsingBC(
int nofDisturbingLines = 0; int nofDisturbingLines = 0;
while(i3 != i3c && i3 != d3ll.end()) while(i3 != i3c && i3 != d3ll.end())
{ {
if((*i3).lineC != -1) if((*i3).getLineC() != -1)
++nofDisturbingLines; ++nofDisturbingLines;
++i3; ++i3;
} }
...@@ -403,18 +403,18 @@ void calcDiff3LineListUsingBC( ...@@ -403,18 +403,18 @@ void calcDiff3LineListUsingBC(
i3 = i3b; i3 = i3b;
while(i3 != i3c) while(i3 != i3c)
{ {
if((*i3).lineC != -1 || if((*i3).getLineC() != -1 ||
(before_or_on_equal_line_in_A && i3->lineA != -1)) (before_or_on_equal_line_in_A && i3->getLineA() != -1))
{ {
d3l.lineC = (*i3).lineC; d3l.setLineC((*i3).getLineC());
(*i3).lineC = -1; (*i3).setLineC(-1);
// Move A along if it matched C // Move A along if it matched C
if(before_or_on_equal_line_in_A) if(before_or_on_equal_line_in_A)
{ {
d3l.lineA = i3->lineA; d3l.setLineA(i3->getLineA());
d3l.bAEqC = i3->bAEqC; d3l.bAEqC = i3->bAEqC;
i3->lineA = -1; i3->setLineA(-1);
i3->bAEqB = false; i3->bAEqB = false;
} }
...@@ -436,10 +436,10 @@ void calcDiff3LineListUsingBC( ...@@ -436,10 +436,10 @@ void calcDiff3LineListUsingBC(
if(nofDisturbingLines == 0) if(nofDisturbingLines == 0)
{ {
// Yes, the line from C can be moved. // Yes, the line from C can be moved.
(*i3c).lineC = -1; // This might leave an empty line: removed later. (*i3c).setLineC(-1); // This might leave an empty line: removed later.
(*i3c).bAEqC = false; (*i3c).bAEqC = false;
(*i3c).bBEqC = false; (*i3c).bBEqC = false;
(*i3b).lineC = lineC; (*i3b).setLineC(lineC);
(*i3b).bBEqC = true; (*i3b).bBEqC = true;
(*i3b).bAEqC = (*i3b).bAEqB; (*i3b).bAEqC = (*i3b).bAEqB;
} }
...@@ -455,14 +455,14 @@ void calcDiff3LineListUsingBC( ...@@ -455,14 +455,14 @@ void calcDiff3LineListUsingBC(
else if(d.diff1 > 0) else if(d.diff1 > 0)
{ {
Diff3LineList::iterator i3 = i3b; Diff3LineList::iterator i3 = i3b;
while((*i3).lineB != lineB) while((*i3).getLineB() != lineB)
++i3; ++i3;
if(i3 != i3b && !(*i3).bAEqB) if(i3 != i3b && !(*i3).bAEqB)
{ {
// Take B from this line and move it up as far as possible // Take B from this line and move it up as far as possible
d3l.lineB = lineB; d3l.setLineB(lineB);
d3ll.insert(i3b, d3l); d3ll.insert(i3b, d3l);
(*i3).lineB = -1; (*i3).setLineB(-1);
} }
else else
{ {
...@@ -490,7 +490,7 @@ void calcDiff3LineListUsingBC( ...@@ -490,7 +490,7 @@ void calcDiff3LineListUsingBC(
for( ; it!=d3ll.end(); ++it, ++li ) for( ; it!=d3ll.end(); ++it, ++li )
{ {
printf( "%4d %4d %4d %4d A%c=B A%c=C B%c=C\n", printf( "%4d %4d %4d %4d A%c=B A%c=C B%c=C\n",
li, (*it).lineA, (*it).lineB, (*it).lineC, li, (*it).getLineA(), (*it).getLineB(), (*it).getLineC(),
(*it).bAEqB ? '=' : '!', (*it).bAEqC ? '=' : '!', (*it).bBEqC ? '=' : '!' ); (*it).bAEqB ? '=' : '!', (*it).bAEqC ? '=' : '!', (*it).bBEqC ? '=' : '!' );
} }
printf("\n");*/ printf("\n");*/
...@@ -771,26 +771,26 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual ...@@ -771,26 +771,26 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual
if(wi == 1) // Move B and C up if(wi == 1) // Move B and C up
{ {
d3l.bBEqC = i3->bBEqC; d3l.bBEqC = i3->bBEqC;
d3l.lineB = i3->lineB; d3l.setLineB(i3->getLineB());
d3l.lineC = i3->lineC; d3l.setLineC(i3->getLineC());
i3->lineB = -1; i3->setLineB(-1);
i3->lineC = -1; i3->setLineC(-1);
} }
if(wi == 2) // Move A and C up if(wi == 2) // Move A and C up
{ {
d3l.bAEqC = i3->bAEqC; d3l.bAEqC = i3->bAEqC;
d3l.lineA = i3->lineA; d3l.setLineA(i3->getLineA());
d3l.lineC = i3->lineC; d3l.setLineC(i3->getLineC());
i3->lineA = -1; i3->setLineA(-1);
i3->lineC = -1; i3->setLineC(-1);
} }
if(wi == 3) // Move A and B up if(wi == 3) // Move A and B up
{ {
d3l.bAEqB = i3->bAEqB; d3l.bAEqB = i3->bAEqB;
d3l.lineA = i3->lineA; d3l.setLineA(i3->getLineA());
d3l.lineB = i3->lineB; d3l.setLineB(i3->getLineB());
i3->lineA = -1; i3->setLineA(-1);
i3->lineB = -1; i3->setLineB(-1);
} }
i3->bAEqB = false; i3->bAEqB = false;
i3->bAEqC = false; i3->bAEqC = false;
...@@ -804,22 +804,22 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual ...@@ -804,22 +804,22 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual
{ {
if(wi2 == 1) if(wi2 == 1)
{ {
iDest->lineA = i3->lineA; iDest->setLineA(i3->getLineA());
i3->lineA = -1; i3->setLineA(-1);
i3->bAEqB = false; i3->bAEqB = false;
i3->bAEqC = false; i3->bAEqC = false;
} }
else if(wi2 == 2) else if(wi2 == 2)
{ {
iDest->lineB = i3->lineB; iDest->setLineB(i3->getLineB());
i3->lineB = -1; i3->setLineB(-1);
i3->bAEqB = false; i3->bAEqB = false;
i3->bBEqC = false; i3->bBEqC = false;
} }
else if(wi2 == 3) else if(wi2 == 3)
{ {
iDest->lineC = i3->lineC; iDest->setLineC(i3->getLineC());
i3->lineC = -1; i3->setLineC(-1);
i3->bBEqC = false; i3->bBEqC = false;
i3->bAEqC = false; i3->bAEqC = false;
} }
...@@ -838,8 +838,8 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual ...@@ -838,8 +838,8 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual
{ {
if(i3->bAEqB) // Stop moving lines up if one equal is found. if(i3->bAEqB) // Stop moving lines up if one equal is found.
break; break;
d3l.lineA = i3->lineA; d3l.setLineA(i3->getLineA());
i3->lineA = -1; i3->setLineA(-1);
i3->bAEqB = false; i3->bAEqB = false;
i3->bAEqC = false; i3->bAEqC = false;
} }
...@@ -847,8 +847,8 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual ...@@ -847,8 +847,8 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual
{ {
if(i3->bAEqB) if(i3->bAEqB)
break; break;
d3l.lineB = i3->lineB; d3l.setLineB(i3->getLineB());
i3->lineB = -1; i3->setLineB(-1);
i3->bAEqB = false; i3->bAEqB = false;
i3->bBEqC = false; i3->bBEqC = false;
} }
...@@ -856,8 +856,8 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual ...@@ -856,8 +856,8 @@ void correctManualDiffAlignment(Diff3LineList& d3ll, ManualDiffHelpList* pManual
{ {
if(i3->bAEqC) if(i3->bAEqC)
break; break;
d3l.lineC = i3->lineC; d3l.setLineC(i3->getLineC());
i3->lineC = -1; i3->setLineC(-1);
i3->bAEqC = false; i3->bAEqC = false;
i3->bBEqC = false; i3->bBEqC = false;
} }
...@@ -898,9 +898,9 @@ void calcDiff3LineListTrim( ...@@ -898,9 +898,9 @@ void calcDiff3LineListTrim(
{ {
if(iMDHL != pManualDiffHelpList->end()) if(iMDHL != pManualDiffHelpList->end())
{ {
if((i3->lineA >= 0 && i3->lineA == iMDHL->getLine1(1)) || if((i3->getLineA() >= 0 && i3->getLineA() == iMDHL->getLine1(1)) ||
(i3->lineB >= 0 && i3->lineB == iMDHL->getLine1(2)) || (i3->getLineB() >= 0 && i3->getLineB() == iMDHL->getLine1(2)) ||
(i3->lineC >= 0 && i3->lineC == iMDHL->getLine1(3))) (i3->getLineC() >= 0 && i3->getLineC() == iMDHL->getLine1(3)))
{ {
i3A = i3; i3A = i3;
i3B = i3; i3B = i3;
...@@ -912,68 +912,68 @@ void calcDiff3LineListTrim( ...@@ -912,68 +912,68 @@ void calcDiff3LineListTrim(
} }
} }
if(line > lineA && (*i3).lineA != -1 && (*i3A).lineB != -1 && (*i3A).bBEqC && if(line > lineA && (*i3).getLineA() != -1 && (*i3A).getLineB() != -1 && (*i3A).bBEqC &&
::equal(pldA[(*i3).lineA], pldB[(*i3A).lineB], false) && ::equal(pldA[(*i3).getLineA()], pldB[(*i3A).getLineB()], false) &&
pManualDiffHelpList->isValidMove((*i3).lineA, (*i3A).lineB, 1, 2) && pManualDiffHelpList->isValidMove((*i3).getLineA(), (*i3A).getLineB(), 1, 2) &&
pManualDiffHelpList->isValidMove((*i3).lineA, (*i3A).lineC, 1, 3)) pManualDiffHelpList->isValidMove((*i3).getLineA(), (*i3A).getLineC(), 1, 3))
{ {
// Empty space for A. A matches B and C in the empty line. Move it up. // Empty space for A. A matches B and C in the empty line. Move it up.
(*i3A).lineA = (*i3).lineA; (*i3A).setLineA((*i3).getLineA());
(*i3A).bAEqB = true; (*i3A).bAEqB = true;
(*i3A).bAEqC = true; (*i3A).bAEqC = true;
(*i3).lineA = -1; (*i3).setLineA(-1);
(*i3).bAEqB = false; (*i3).bAEqB = false;
(*i3).bAEqC = false; (*i3).bAEqC = false;
++i3A; ++i3A;
++lineA; ++lineA;
} }
if(line > lineB && (*i3).lineB != -1 && (*i3B).lineA != -1 && (*i3B).bAEqC && if(line > lineB && (*i3).getLineB() != -1 && (*i3B).getLineA() != -1 && (*i3B).bAEqC &&
::equal(pldB[(*i3).lineB], pldA[(*i3B).lineA], false) && ::equal(pldB[(*i3).getLineB()], pldA[(*i3B).getLineA()], false) &&
pManualDiffHelpList->isValidMove((*i3).lineB, (*i3B).lineA, 2, 1) && pManualDiffHelpList->isValidMove((*i3).getLineB(), (*i3B).getLineA(), 2, 1) &&
pManualDiffHelpList->isValidMove((*i3).lineB, (*i3B).lineC, 2, 3)) pManualDiffHelpList->isValidMove((*i3).getLineB(), (*i3B).getLineC(), 2, 3))
{ {
// Empty space for B. B matches A and C in the empty line. Move it up. // Empty space for B. B matches A and C in the empty line. Move it up.
(*i3B).lineB = (*i3).lineB; (*i3B).setLineB((*i3).getLineB());
(*i3B).bAEqB = true; (*i3B).bAEqB = true;
(*i3B).bBEqC = true; (*i3B).bBEqC = true;
(*i3).lineB = -1; (*i3).setLineB(-1);
(*i3).bAEqB = false; (*i3).bAEqB = false;
(*i3).bBEqC = false; (*i3).bBEqC = false;
++i3B; ++i3B;
++lineB; ++lineB;
} }
if(line > lineC && (*i3).lineC != -1 && (*i3C).lineA != -1 && (*i3C).bAEqB && if(line > lineC && (*i3).getLineC() != -1 && (*i3C).getLineA() != -1 && (*i3C).bAEqB &&
::equal(pldC[(*i3).lineC], pldA[(*i3C).lineA], false) && ::equal(pldC[(*i3).getLineC()], pldA[(*i3C).getLineA()], false) &&
pManualDiffHelpList->isValidMove((*i3).lineC, (*i3C).lineA, 3, 1) && pManualDiffHelpList->isValidMove((*i3).getLineC(), (*i3C).getLineA(), 3, 1) &&
pManualDiffHelpList->isValidMove((*i3).lineC, (*i3C).lineB, 3, 2)) pManualDiffHelpList->isValidMove((*i3).getLineC(), (*i3C).getLineB(), 3, 2))
{ {
// Empty space for C. C matches A and B in the empty line. Move it up. // Empty space for C. C matches A and B in the empty line. Move it up.
(*i3C).lineC = (*i3).lineC; (*i3C).setLineC((*i3).getLineC());
(*i3C).bAEqC = true; (*i3C).bAEqC = true;
(*i3C).bBEqC = true; (*i3C).bBEqC = true;
(*i3).lineC = -1; (*i3).setLineC(-1);
(*i3).bAEqC = false; (*i3).bAEqC = false;
(*i3).bBEqC = false; (*i3).bBEqC = false;
++i3C; ++i3C;
++lineC; ++lineC;
} }
if(line > lineA && (*i3).lineA != -1 && !(*i3).bAEqB && !(*i3).bAEqC && if(line > lineA && (*i3).getLineA() != -1 && !(*i3).bAEqB && !(*i3).bAEqC &&
pManualDiffHelpList->isValidMove((*i3).lineA, (*i3A).lineB, 1, 2) && pManualDiffHelpList->isValidMove((*i3).getLineA(), (*i3A).getLineB(), 1, 2) &&
pManualDiffHelpList->isValidMove((*i3).lineA, (*i3A).lineC, 1, 3)) { pManualDiffHelpList->isValidMove((*i3).getLineA(), (*i3A).getLineC(), 1, 3)) {
// Empty space for A. A doesn't match B or C. Move it up. // Empty space for A. A doesn't match B or C. Move it up.
(*i3A).lineA = (*i3).lineA; (*i3A).setLineA((*i3).getLineA());
(*i3).lineA = -1; (*i3).setLineA(-1);
if(i3A->lineB != -1 && ::equal(pldA[i3A->lineA], pldB[i3A->lineB], false)) if(i3A->getLineB() != -1 && ::equal(pldA[i3A->getLineA()], pldB[i3A->getLineB()], false))
{ {
i3A->bAEqB = true; i3A->bAEqB = true;
} }
if((i3A->bAEqB && i3A->bBEqC) || if((i3A->bAEqB && i3A->bBEqC) ||
(i3A->lineC != -1 && ::equal(pldA[i3A->lineA], pldC[i3A->lineC], false))) (i3A->getLineC() != -1 && ::equal(pldA[i3A->getLineA()], pldC[i3A->getLineC()], false)))
{ {
i3A->bAEqC = true; i3A->bAEqC = true;
} }
...@@ -982,20 +982,20 @@ void calcDiff3LineListTrim( ...@@ -982,20 +982,20 @@ void calcDiff3LineListTrim(
++lineA; ++lineA;
} }
if(line > lineB && (*i3).lineB != -1 && !(*i3).bAEqB && !(*i3).bBEqC && if(line > lineB && (*i3).getLineB() != -1 && !(*i3).bAEqB && !(*i3).bBEqC &&
pManualDiffHelpList->isValidMove((*i3).lineB, (*i3B).lineA, 2, 1) && pManualDiffHelpList->isValidMove((*i3).getLineB(), (*i3B).getLineA(), 2, 1) &&
pManualDiffHelpList->isValidMove((*i3).lineB, (*i3B).lineC, 2, 3)) pManualDiffHelpList->isValidMove((*i3).getLineB(), (*i3B).getLineC(), 2, 3))
{ {
// Empty space for B. B matches neither A nor C. Move B up. // Empty space for B. B matches neither A nor C. Move B up.
(*i3B).lineB = (*i3).lineB; (*i3B).setLineB((*i3).getLineB());
(*i3).lineB = -1; (*i3).setLineB(-1);
if(i3B->lineA != -1 && ::equal(pldA[i3B->lineA], pldB[i3B->lineB], false)) if(i3B->getLineA() != -1 && ::equal(pldA[i3B->getLineA()], pldB[i3B->getLineB()], false))
{ {
i3B->bAEqB = true; i3B->bAEqB = true;
} }
if((i3B->bAEqB && i3B->bAEqC) || if((i3B->bAEqB && i3B->bAEqC) ||
(i3B->lineC != -1 && ::equal(pldB[i3B->lineB], pldC[i3B->lineC], false))) (i3B->getLineC() != -1 && ::equal(pldB[i3B->getLineB()], pldC[i3B->getLineC()], false)))
{ {
i3B->bBEqC = true; i3B->bBEqC = true;
} }
...@@ -1004,20 +1004,20 @@ void calcDiff3LineListTrim( ...@@ -1004,20 +1004,20 @@ void calcDiff3LineListTrim(
++lineB; ++lineB;
} }
if(line > lineC && (*i3).lineC != -1 && !(*i3).bAEqC && !(*i3).bBEqC && if(line > lineC && (*i3).getLineC() != -1 && !(*i3).bAEqC && !(*i3).bBEqC &&
pManualDiffHelpList->isValidMove( (*i3).lineC, (*i3C).lineA, 3, 1) && pManualDiffHelpList->isValidMove( (*i3).getLineC(), (*i3C).getLineA(), 3, 1) &&
pManualDiffHelpList->isValidMove( (*i3).lineC, (*i3C).lineB, 3, 2)) pManualDiffHelpList->isValidMove( (*i3).getLineC(), (*i3C).getLineB(), 3, 2))
{ {
// Empty space for C. C matches neither A nor B. Move C up. // Empty space for C. C matches neither A nor B. Move C up.
(*i3C).lineC = (*i3).lineC; (*i3C).setLineC((*i3).getLineC());
(*i3).lineC = -1; (*i3).setLineC(-1);
if(i3C->lineA != -1 && ::equal(pldA[i3C->lineA], pldC[i3C->lineC], false)) if(i3C->getLineA() != -1 && ::equal(pldA[i3C->getLineA()], pldC[i3C->getLineC()], false))
{ {
i3C->bAEqC = true; i3C->bAEqC = true;
} }
if((i3C->bAEqC && i3C->bAEqB) || if((i3C->bAEqC && i3C->bAEqB) ||
(i3C->lineB != -1 && ::equal(pldB[i3C->lineB], pldC[i3C->lineC], false))) (i3C->getLineB() != -1 && ::equal(pldB[i3C->getLineB()], pldC[i3C->getLineC()], false)))
{ {
i3C->bBEqC = true; i3C->bBEqC = true;
} }
...@@ -1026,27 +1026,27 @@ void calcDiff3LineListTrim( ...@@ -1026,27 +1026,27 @@ void calcDiff3LineListTrim(
++lineC; ++lineC;