Commit 620e4164 authored by Michael Reeves's avatar Michael Reeves

make calcManualDiffFirstDiff3LineIdx a member function

parent 1800b40a
......@@ -261,6 +261,8 @@ class ManualDiffHelpEntry
return lineA1 == r.lineA1 && lineB1 == r.lineB1 && lineC1 == r.lineC1 &&
lineA2 == r.lineA2 && lineB2 == r.lineB2 && lineC2 == r.lineC2;
}
int calcManualDiffFirstDiff3LineIdx(const Diff3LineVector& d3lv);
bool isValidMove(int line1, int line2, int winIdx1, int winIdx2) const;
};
......
......@@ -748,15 +748,15 @@ void KDiff3App::initView()
showWindowC->setChecked(true);
}
static int calcManualDiffFirstDiff3LineIdx(const Diff3LineVector& d3lv, const ManualDiffHelpEntry& mdhe)
int ManualDiffHelpEntry::calcManualDiffFirstDiff3LineIdx(const Diff3LineVector& d3lv)
{
int i;
for(i = 0; i < d3lv.size(); ++i)
{
const Diff3Line& d3l = *d3lv[i];
if((mdhe.lineA1 >= 0 && mdhe.lineA1 == d3l.lineA) ||
(mdhe.lineB1 >= 0 && mdhe.lineB1 == d3l.lineB) ||
(mdhe.lineC1 >= 0 && mdhe.lineC1 == d3l.lineC))
if((lineA1 >= 0 && lineA1 == d3l.lineA) ||
(lineB1 >= 0 && lineB1 == d3l.lineB) ||
(lineC1 >= 0 && lineC1 == d3l.lineC))
return i;
}
return -1;
......@@ -779,7 +779,7 @@ void KDiff3App::slotFinishMainInit()
int d3l = -1;
if(!m_manualDiffHelpList.empty())
d3l = calcManualDiffFirstDiff3LineIdx(m_diff3LineVector, m_manualDiffHelpList.front());
d3l = m_manualDiffHelpList.front().calcManualDiffFirstDiff3LineIdx(m_diff3LineVector);
if(d3l >= 0 && m_pDiffTextWindow1)
{
int line = m_pDiffTextWindow1->convertDiff3LineIdxToLine(d3l);
......
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