Commit ec530963 authored by Michael Reeves's avatar Michael Reeves

runDiff ManualDiffHelpList

parent 49561cec
......@@ -638,9 +638,8 @@ static bool runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineR
return true;
}
bool runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineRef size2, DiffList& diffList,
bool ManualDiffHelpList::runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineRef size2, DiffList& diffList,
int winIdx1, int winIdx2,
ManualDiffHelpList* pManualDiffHelpList,
Options* pOptions)
{
Q_ASSERT(p1 != nullptr && p2 != nullptr);
......@@ -650,7 +649,7 @@ bool runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineRef size
int l1begin = 0;
int l2begin = 0;
ManualDiffHelpList::const_iterator i;
for(i = pManualDiffHelpList->begin(); i != pManualDiffHelpList->end(); ++i)
for(i = begin(); i != end(); ++i)
{
const ManualDiffHelpEntry& mdhe = *i;
......@@ -659,7 +658,7 @@ bool runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineRef size
if(l1end >= 0 && l2end >= 0)
{
runDiff(p1 + l1begin, l1end - l1begin, p2 + l2begin, l2end - l2begin, diffList2, pOptions);
::runDiff(p1 + l1begin, l1end - l1begin, p2 + l2begin, l2end - l2begin, diffList2, pOptions);
diffList.splice(diffList.end(), diffList2);
l1begin = l1end;
l2begin = l2end;
......@@ -671,14 +670,14 @@ bool runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineRef size
{
++l1end; // point to line after last selected line
++l2end;
runDiff(p1 + l1begin, l1end - l1begin, p2 + l2begin, l2end - l2begin, diffList2, pOptions);
::runDiff(p1 + l1begin, l1end - l1begin, p2 + l2begin, l2end - l2begin, diffList2, pOptions);
diffList.splice(diffList.end(), diffList2);
l1begin = l1end;
l2begin = l2end;
}
}
}
runDiff(p1 + l1begin, size1 - l1begin, p2 + l2begin, size2 - l2begin, diffList2, pOptions);
::runDiff(p1 + l1begin, size1 - l1begin, p2 + l2begin, size2 - l2begin, diffList2, pOptions);
diffList.splice(diffList.end(), diffList2);
return true;
}
......
......@@ -326,6 +326,10 @@ class ManualDiffHelpList: public std::list<ManualDiffHelpEntry>
public:
bool isValidMove(int line1, int line2, int winIdx1, int winIdx2) const;
void insertEntry(int winIdx, LineRef firstLine, LineRef lastLine);
bool runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineRef size2, DiffList& diffList,
int winIdx1, int winIdx2,
Options* pOptions);
};
void calcDiff3LineListUsingAB(
......@@ -401,9 +405,6 @@ class MyPainter : public QPainter
}
};
bool runDiff(const LineData* p1, LineRef size1, const LineData* p2, LineRef size2, DiffList& diffList, int winIdx1, int winIdx2,
ManualDiffHelpList* pManualDiffHelpList, Options* pOptions);
bool fineDiff(
Diff3LineList& diff3LineList,
int selector,
......
......@@ -197,8 +197,8 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
if(m_sd1.hasData() && m_sd1.isText() && m_sd2.hasData() && m_sd2.isText())
{
pp.setInformation(i18n("Diff: A <-> B"));
runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, 1, 2,
&m_manualDiffHelpList, &m_pOptionDialog->m_options);
m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, 1, 2,
&m_pOptionDialog->m_options);
pp.step();
......@@ -239,8 +239,8 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
pp.setInformation(i18n("Diff: A <-> B"));
if(m_sd1.hasData() && m_sd2.hasData() && m_sd1.isText() && m_sd2.isText())
{
runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, 1, 2,
&m_manualDiffHelpList, &m_pOptionDialog->m_options);
m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, 1, 2,
&m_pOptionDialog->m_options);
calcDiff3LineListUsingAB(&m_diffList12, m_diff3LineList);
}
......@@ -248,8 +248,8 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
pp.setInformation(i18n("Diff: A <-> C"));
if(m_sd1.hasData() && m_sd1.isText() && m_sd3.hasData() && m_sd3.isText())
{
runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList13, 1, 3,
&m_manualDiffHelpList, &m_pOptionDialog->m_options);
m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList13, 1, 3,
&m_pOptionDialog->m_options);
calcDiff3LineListUsingAC(&m_diffList13, m_diff3LineList);
correctManualDiffAlignment(m_diff3LineList, &m_manualDiffHelpList);
......@@ -259,8 +259,8 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
pp.setInformation(i18n("Diff: B <-> C"));
if(m_sd2.hasData() && m_sd2.isText() && m_sd3.hasData() && m_sd3.isText())
{
runDiff(m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList23, 2, 3,
&m_manualDiffHelpList, &m_pOptionDialog->m_options);
m_manualDiffHelpList.runDiff(m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList23, 2, 3,
&m_pOptionDialog->m_options);
if(m_pOptions->m_bDiff3AlignBC)
{
calcDiff3LineListUsingBC(&m_diffList23, m_diff3LineList);
......
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