Commit 2c8c09e0 authored by Michael Reeves's avatar Michael Reeves

Fix text file diff not shown on comparison to empty/missing file.

CCBUG:410008
parent 035816d1
Pipeline #5915 passed with stage
in 9 minutes and 2 seconds
...@@ -194,7 +194,7 @@ const QString& SourceData::getText() const ...@@ -194,7 +194,7 @@ const QString& SourceData::getText() const
bool SourceData::isText() bool SourceData::isText()
{ {
return m_normalData.isText(); return m_normalData.isText() || m_normalData.isEmpty();
} }
bool SourceData::isIncompleteConversion() bool SourceData::isIncompleteConversion()
...@@ -523,7 +523,7 @@ QStringList SourceData::readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetec ...@@ -523,7 +523,7 @@ QStringList SourceData::readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetec
return errors; return errors;
} }
Q_ASSERT(m_lmppData.isText()); Q_ASSERT(m_lmppData.isText() && !m_lmppData.isEmpty());
//TODO: Needed? //TODO: Needed?
if(m_lmppData.m_vSize < m_normalData.m_vSize) if(m_lmppData.m_vSize < m_normalData.m_vSize)
{ {
......
...@@ -112,7 +112,7 @@ class SourceData ...@@ -112,7 +112,7 @@ class SourceData
bool isEmpty() { return m_size == 0; } bool isEmpty() { return m_size == 0; }
bool isText() { return m_bIsText; } bool isText() { return m_bIsText || isEmpty(); }
}; };
FileData m_normalData; FileData m_normalData;
FileData m_lmppData; FileData m_lmppData;
......
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