summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cpprefactoringchanges.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cppeditor/cpprefactoringchanges.cpp')
-rw-r--r--src/plugins/cppeditor/cpprefactoringchanges.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp
index 1cce747fc6..bb34174d06 100644
--- a/src/plugins/cppeditor/cpprefactoringchanges.cpp
+++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp
@@ -57,8 +57,8 @@ CppRefactoringFilePtr CppRefactoringChanges::file(const FilePath &filePath) cons
CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &filePath) const
{
QTextDocument *document = nullptr;
- if (data()->m_workingCopy.contains(filePath))
- document = new QTextDocument(QString::fromUtf8(data()->m_workingCopy.source(filePath)));
+ if (const auto source = data()->m_workingCopy.source(filePath))
+ document = new QTextDocument(QString::fromUtf8(*source));
CppRefactoringFilePtr result(new CppRefactoringFile(document, filePath));
result->m_data = m_data;