diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp index e15dca72cb8..207d359cb88 100644 --- a/src/plugins/cppeditor/cpprefactoringchanges.cpp +++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp @@ -60,12 +60,12 @@ CppRefactoringFilePtr CppRefactoringChanges::file(TextEditor::TextEditorWidget * TextEditor::RefactoringFilePtr CppRefactoringChanges::file(const FilePath &filePath) const { - return TextEditor::RefactoringFilePtr(new CppRefactoringFile(filePath, m_data)); + return cppFile(filePath); } CppRefactoringFilePtr CppRefactoringChanges::cppFile(const Utils::FilePath &filePath) const { - return file(filePath).staticCast(); + return CppRefactoringFilePtr(new CppRefactoringFile(filePath, m_data)); } CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &filePath) const diff --git a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp index 0e03454250a..66ce4102b43 100644 --- a/src/plugins/qmljstools/qmljsrefactoringchanges.cpp +++ b/src/plugins/qmljstools/qmljsrefactoringchanges.cpp @@ -36,12 +36,12 @@ QmlJSRefactoringChanges::QmlJSRefactoringChanges(ModelManagerInterface *modelMan TextEditor::RefactoringFilePtr QmlJSRefactoringChanges::file(const Utils::FilePath &filePath) const { - return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(filePath, m_data)); + return qmlJSFile(filePath); } QmlJSRefactoringFilePtr QmlJSRefactoringChanges::qmlJSFile(const Utils::FilePath &filePath) const { - return file(filePath).staticCast(); + return QmlJSRefactoringFilePtr(new QmlJSRefactoringFile(filePath, m_data)); } QmlJSRefactoringFilePtr QmlJSRefactoringChanges::file(