forked from qt-creator/qt-creator
TextEditor: Remove RefactoringChanges::m_data
There is no use for a data member in the base class. Change-Id: I126d8713d2a7bf4061ecbd60b4c144d39c08d550 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -34,15 +34,10 @@ static std::unique_ptr<TextEditor::Indenter> createIndenter(const FilePath &file
|
||||
}
|
||||
|
||||
CppRefactoringChanges::CppRefactoringChanges(const Snapshot &snapshot)
|
||||
: RefactoringChanges(new CppRefactoringChangesData(snapshot))
|
||||
: m_data(new CppRefactoringChangesData(snapshot))
|
||||
{
|
||||
}
|
||||
|
||||
CppRefactoringChangesData *CppRefactoringChanges::data() const
|
||||
{
|
||||
return static_cast<CppRefactoringChangesData *>(m_data.data());
|
||||
}
|
||||
|
||||
CppRefactoringFilePtr CppRefactoringChanges::file(TextEditor::TextEditorWidget *editor, const Document::Ptr &document)
|
||||
{
|
||||
CppRefactoringFilePtr result(new CppRefactoringFile(editor));
|
||||
@@ -52,8 +47,7 @@ CppRefactoringFilePtr CppRefactoringChanges::file(TextEditor::TextEditorWidget *
|
||||
|
||||
TextEditor::RefactoringFilePtr CppRefactoringChanges::file(const FilePath &filePath) const
|
||||
{
|
||||
CppRefactoringFilePtr result(new CppRefactoringFile(filePath, m_data.staticCast<CppRefactoringChangesData>()));
|
||||
return result;
|
||||
return TextEditor::RefactoringFilePtr(new CppRefactoringFile(filePath, m_data));
|
||||
}
|
||||
|
||||
CppRefactoringFilePtr CppRefactoringChanges::cppFile(const Utils::FilePath &filePath) const
|
||||
@@ -64,7 +58,7 @@ CppRefactoringFilePtr CppRefactoringChanges::cppFile(const Utils::FilePath &file
|
||||
CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &filePath) const
|
||||
{
|
||||
QTextDocument *document = nullptr;
|
||||
if (const auto source = data()->m_workingCopy.source(filePath))
|
||||
if (const auto source = m_data->m_workingCopy.source(filePath))
|
||||
document = new QTextDocument(QString::fromUtf8(*source));
|
||||
CppRefactoringFilePtr result(new CppRefactoringFile(document, filePath));
|
||||
result->m_data = m_data.staticCast<CppRefactoringChangesData>();
|
||||
@@ -74,7 +68,7 @@ CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &f
|
||||
|
||||
const Snapshot &CppRefactoringChanges::snapshot() const
|
||||
{
|
||||
return data()->m_snapshot;
|
||||
return m_data->m_snapshot;
|
||||
}
|
||||
|
||||
CppRefactoringFile::CppRefactoringFile(const FilePath &filePath, const QSharedPointer<CppRefactoringChangesData> &data)
|
||||
|
||||
Reference in New Issue
Block a user