CppTools: Replace "\r\n" with "\n" in cpp file content

When we get the file working copy it never contains "\r\n"
line endings. Let's provide the same behavior when we have
no working copy and read the file from disk.

Task-number: QTCREATORBUG-19905
Change-Id: I720d62426860dcdcdd8520db5430d9f4f5900ab6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-02-23 10:10:49 +01:00
parent bde42d755f
commit b276de576f

View File

@@ -228,6 +228,7 @@ bool CppSourceProcessor::getFileContents(const QString &absoluteFilePath,
qPrintable(error));
return false;
}
contents->replace("\r\n", "\n");
return true;
}