Commit 97515546 authored by Michael Reeves's avatar Michael Reeves

make calcDiff3LineVector a member function

This function is a converter from Diff3LineList to Diff3LineVector.
parent 291436ec
...@@ -1449,12 +1449,12 @@ bool Diff3LineList::fineDiff(const int selector, const LineData* v1, const LineD ...@@ -1449,12 +1449,12 @@ bool Diff3LineList::fineDiff(const int selector, const LineData* v1, const LineD
} }
// Convert the list to a vector of pointers // Convert the list to a vector of pointers
void calcDiff3LineVector(Diff3LineList& d3ll, Diff3LineVector& d3lv) void Diff3LineList::calcDiff3LineVector(Diff3LineVector& d3lv)
{ {
d3lv.resize(d3ll.size()); d3lv.resize(size());
Diff3LineList::iterator i; Diff3LineList::iterator i;
int j = 0; int j = 0;
for(i = d3ll.begin(); i != d3ll.end(); ++i, ++j) for(i = begin(); i != end(); ++i, ++j)
{ {
d3lv[j] = &(*i); d3lv[j] = &(*i);
} }
......
...@@ -201,6 +201,7 @@ class Diff3LineList : public QList<Diff3Line> ...@@ -201,6 +201,7 @@ class Diff3LineList : public QList<Diff3Line>
{ {
public: public:
bool fineDiff(const int selector, const LineData* v1, const LineData* v2); bool fineDiff(const int selector, const LineData* v1, const LineData* v2);
void calcDiff3LineVector(Diff3LineVector& d3lv);
}; };
class Diff3LineVector : public QVector<Diff3Line*> class Diff3LineVector : public QVector<Diff3Line*>
......
...@@ -324,7 +324,7 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo ...@@ -324,7 +324,7 @@ void KDiff3App::mainInit(TotalDiffStatus* pTotalDiffStatus, bool bLoadFiles, boo
m_sd3.getLineDataForDiff(), m_sd3.getSizeLines()); m_sd3.getLineDataForDiff(), m_sd3.getSizeLines());
calcWhiteDiff3Lines(m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff()); calcWhiteDiff3Lines(m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff());
calcDiff3LineVector(m_diff3LineList, m_diff3LineVector); m_diff3LineList.calcDiff3LineVector(m_diff3LineVector);
} }
// Calc needed lines for display // Calc needed lines for display
......
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