Commit a62de989 authored by Michael Reeves's avatar Michael Reeves

addAccessor functions

parent 1a1d5c23
......@@ -139,13 +139,13 @@ void Overview::drawColumn(QPainter& p, e_OverviewMode eOverviewMode, int x, int
case eBDeleted:
case eBChanged:
c = bConflict ? m_pOptions->m_colorForConflict : m_pOptions->m_colorB;
bWhiteSpaceChange = d3l.bAEqB || (d3l.bWhiteLineA && d3l.bWhiteLineB);
bWhiteSpaceChange = d3l.isEqualAB() || (d3l.bWhiteLineA && d3l.bWhiteLineB);
break;
case eCAdded:
case eCDeleted:
case eCChanged:
bWhiteSpaceChange = d3l.bAEqC || (d3l.bWhiteLineA && d3l.bWhiteLineC);
bWhiteSpaceChange = d3l.isEqualAC() || (d3l.bWhiteLineA && d3l.bWhiteLineC);
c = bConflict ? m_pOptions->m_colorForConflict : m_pOptions->m_colorC;
break;
......@@ -175,7 +175,7 @@ void Overview::drawColumn(QPainter& p, e_OverviewMode eOverviewMode, int x, int
break;
default:
c = m_pOptions->m_colorForConflict;
bWhiteSpaceChange = d3l.bAEqB || (d3l.bWhiteLineA && d3l.bWhiteLineB);
bWhiteSpaceChange = d3l.isEqualAB() || (d3l.bWhiteLineA && d3l.bWhiteLineB);
break;
}
}
......@@ -191,7 +191,7 @@ void Overview::drawColumn(QPainter& p, e_OverviewMode eOverviewMode, int x, int
break;
default:
c = m_pOptions->m_colorForConflict;
bWhiteSpaceChange = d3l.bAEqC || (d3l.bWhiteLineA && d3l.bWhiteLineC);
bWhiteSpaceChange = d3l.isEqualAC() || (d3l.bWhiteLineA && d3l.bWhiteLineC);
break;
}
}
......@@ -207,7 +207,7 @@ void Overview::drawColumn(QPainter& p, e_OverviewMode eOverviewMode, int x, int
break;
default:
c = m_pOptions->m_colorForConflict;
bWhiteSpaceChange = d3l.bBEqC || (d3l.bWhiteLineB && d3l.bWhiteLineC);
bWhiteSpaceChange = d3l.isEqualBC() || (d3l.bWhiteLineB && d3l.bWhiteLineC);
break;
}
}
......
This diff is collapsed.
......@@ -143,9 +143,13 @@ class Diff3Line
LineRef getLineB() const { return lineB; }
LineRef getLineC() const { return lineC; }
void setLineA(const LineRef& line) { lineA = line; }
void setLineB(const LineRef& line) { lineB = line; }
void setLineC(const LineRef& line) { lineC = line; }
inline void setLineA(const LineRef& line) { lineA = line; }
inline void setLineB(const LineRef& line) { lineB = line; }
inline void setLineC(const LineRef& line) { lineC = line; }
inline bool isEqualAB() const { return bAEqB; }
inline bool isEqualAC() const { return bAEqC; }
inline bool isEqualBC() const { return bBEqC; }
bool operator==(const Diff3Line& d3l) const
{
......
......@@ -316,7 +316,7 @@ bool MergeResultWindow::sameKindCheck(const MergeLine& ml1, const MergeLine& ml2
{
// Both lines have conflicts: If one is only a white space conflict and
// the other one is a real conflict, then this line returns false.
return ml1.id3l->bAEqC == ml2.id3l->bAEqC && ml1.id3l->bAEqB == ml2.id3l->bAEqB;
return ml1.id3l->isEqualAC() == ml2.id3l->isEqualAC() && ml1.id3l->isEqualAB() == ml2.id3l->isEqualAB();
}
else
return (
......@@ -354,8 +354,8 @@ void MergeResultWindow::merge(bool bAutoSolve, int defaultSelector, bool bConfli
// Automatic solving for only whitespace changes.
if(ml.bConflict &&
((m_pldC == nullptr && (d.bAEqB || (d.bWhiteLineA && d.bWhiteLineB))) ||
(m_pldC != nullptr && ((d.bAEqB && d.bAEqC) || (d.bWhiteLineA && d.bWhiteLineB && d.bWhiteLineC)))))
((m_pldC == nullptr && (d.isEqualAB() || (d.bWhiteLineA && d.bWhiteLineB))) ||
(m_pldC != nullptr && ((d.isEqualAB() && d.isEqualAC()) || (d.bWhiteLineA && d.bWhiteLineB && d.bWhiteLineC)))))
{
ml.bWhiteSpaceConflict = true;
}
......
......@@ -86,7 +86,7 @@ void printDiff3List(const Diff3LineList &diff3LineList,
.arg(lineCText, -columnsize);
if(verbose || forceVerbosity)
{
out << " " << d3l.bAEqB << " " << d3l.bBEqC << " " << d3l.bAEqC;
out << " " << d3l.isEqualAB() << " " << d3l.isEqualBC() << " " << d3l.isEqualAC();
}
out << endl;
......@@ -346,17 +346,17 @@ bool runTest(QString file1, QString file2, QString file3, QString expectedResult
QString lineBText = (p_actual->lineB == -1) ? "" : getLineFromSourceData(m_sd2, p_actual->lineB).simplified().replace(" ", "");
QString lineCText = (p_actual->lineC == -1) ? "" : getLineFromSourceData(m_sd3, p_actual->lineC).simplified().replace(" ", "");
if(!dataIsConsistent(p_actual->lineA, lineAText, p_actual->lineB, lineBText, p_actual->bAEqB))
if(!dataIsConsistent(p_actual->lineA, lineAText, p_actual->lineB, lineBText, p_actual->isEqualAB()))
{
if(verbose) out << "inconsistency: line " << p_actual->lineA << " of A vs line " << p_actual->lineB << " of B" << endl;
consistencyError = true;
}
if(!dataIsConsistent(p_actual->lineB, lineBText, p_actual->lineC, lineCText, p_actual->bBEqC))
if(!dataIsConsistent(p_actual->lineB, lineBText, p_actual->lineC, lineCText, p_actual->isEqualBC()))
{
if(verbose) out << "inconsistency: line " << p_actual->lineB << " of B vs line " << p_actual->lineC << " of C" << endl;
consistencyError = true;
}
if(!dataIsConsistent(p_actual->lineA, lineAText, p_actual->lineC, lineCText, p_actual->bAEqC))
if(!dataIsConsistent(p_actual->lineA, lineAText, p_actual->lineC, lineCText, p_actual->isEqualAC()))
{
if(verbose) out << "inconsistency: line " << p_actual->lineA << " of A vs line " << p_actual->lineC << " of C" << endl;
consistencyError = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment