C++: Synchronize function decl/def refactoring.

When editing a function declaration or definition the code model
may realize the same changes have to be applied somewhere else. A
refactoring marker will pop up that can be clicked to perform the
changes. Alternatively, press enter to apply.

Change-Id: I2299a2ecfb6a8f87d4853fc7cfa99486f890a1d3
Reviewed-on: http://codereview.qt.nokia.com/2909
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-10 09:50:04 +02:00
parent 13c8f9eaaa
commit 8f14bc0ea2
14 changed files with 973 additions and 92 deletions

View File

@@ -110,13 +110,13 @@ CppRefactoringFile::CppRefactoringFile(const QString &fileName, CppRefactoringCh
m_cppDocument = snapshot.document(fileName);
}
CppRefactoringFile::CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor, CPlusPlus::Document::Ptr document)
: RefactoringFile()
, m_cppDocument(document)
{
m_fileName = document->fileName();
m_editor = editor;
}
CppRefactoringFile::CppRefactoringFile(QTextDocument *document, const QString &fileName)
: RefactoringFile(document, fileName)
{ }
CppRefactoringFile::CppRefactoringFile(TextEditor::BaseTextEditorWidget *editor)
: RefactoringFile(editor)
{ }
Document::Ptr CppRefactoringFile::cppDocument() const
{
@@ -134,6 +134,11 @@ Document::Ptr CppRefactoringFile::cppDocument() const
return m_cppDocument;
}
void CppRefactoringFile::setCppDocument(Document::Ptr document)
{
m_cppDocument = document;
}
Scope *CppRefactoringFile::scopeAt(unsigned index) const
{
unsigned line, column;