Commit ef103957 authored by Michael Reeves's avatar Michael Reeves

make bContainsPureComment private

parent 596d6e85
......@@ -502,7 +502,7 @@ QStringList SourceData::readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetec
LineRef vSize = (LineRef)std::min(m_normalData.m_vSize, m_lmppData.m_vSize);
for(int i = 0; i < (int)vSize; ++i)
{
m_normalData.m_v[i].bContainsPureComment = m_lmppData.m_v[i].bContainsPureComment;
m_normalData.m_v[i].setPureComment(m_lmppData.m_v[i].isPureComment());
}
}
......@@ -766,7 +766,7 @@ void SourceData::FileData::removeComments()
// end of line
Q_ASSERT(isLineOrBufEnd(p, i, size));
m_v[line].bContainsPureComment = bCommentInLine && bWhite;
m_v[line].setPureComment(bCommentInLine && bWhite);
/* std::cout << line << " : " <<
( bCommentInLine ? "c" : " " ) <<
( bWhite ? "w " : " ") <<
......
......@@ -1149,9 +1149,9 @@ void Diff3LineList::calcWhiteDiff3Lines(
for(i3=begin(); i3 != end(); ++i3)
{
i3->bWhiteLineA = ((*i3).getLineA() == -1 || pldA == nullptr || pldA[(*i3).getLineA()].whiteLine() || pldA[(*i3).getLineA()].bContainsPureComment);
i3->bWhiteLineB = ((*i3).getLineB() == -1 || pldB == nullptr || pldB[(*i3).getLineB()].whiteLine() || pldB[(*i3).getLineB()].bContainsPureComment);
i3->bWhiteLineC = ((*i3).getLineC() == -1 || pldC == nullptr || pldC[(*i3).getLineC()].whiteLine() || pldC[(*i3).getLineC()].bContainsPureComment);
i3->bWhiteLineA = ((*i3).getLineA() == -1 || pldA == nullptr || pldA[(*i3).getLineA()].whiteLine() || pldA[(*i3).getLineA()].isPureComment());
i3->bWhiteLineB = ((*i3).getLineB() == -1 || pldB == nullptr || pldB[(*i3).getLineB()].whiteLine() || pldB[(*i3).getLineB()].isPureComment());
i3->bWhiteLineC = ((*i3).getLineC() == -1 || pldC == nullptr || pldC[(*i3).getLineC()].whiteLine() || pldC[(*i3).getLineC()].isPureComment());
}
}
......@@ -1381,7 +1381,7 @@ bool Diff3Line::fineDiff(const int selector, const LineData* v1, const LineData*
setFineDiff(selector, pDiffList);
}
if((v1[k1].bContainsPureComment || v1[k1].whiteLine()) && (v2[k2].bContainsPureComment || v2[k2].whiteLine()))
if((v1[k1].isPureComment() || v1[k1].whiteLine()) && (v2[k2].isPureComment() || v2[k2].whiteLine()))
{
if(selector == 1)
{
......
......@@ -63,12 +63,13 @@ typedef std::list<Diff> DiffList;
class LineData
{
private:
private:
const QChar* pLine = nullptr;
const QChar* pFirstNonWhiteChar = nullptr;
int mSize = 0;
public:
bool bContainsPureComment = false;
public:
inline int size() const { return mSize; }
inline void setSize(const int newSize) { mSize = newSize; }
......@@ -80,6 +81,9 @@ class LineData
int width(int tabSize) const; // Calcs width considering tabs.
//int occurrences;
bool whiteLine() const { return pFirstNonWhiteChar - pLine == mSize; }
bool isPureComment() const { return bContainsPureComment; }
void setPureComment(const bool bPureComment) { bContainsPureComment = bPureComment; }
};
class 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