C++ Editor: check for method existing decl/def when inserting new ones.

This commit is contained in:
Erik Verbruggen
2010-10-06 15:49:59 +02:00
parent 0555837c7f
commit ac9fc40645
4 changed files with 60 additions and 46 deletions

View File

@@ -104,7 +104,8 @@ CppRefactoringFile::CppRefactoringFile(TextEditor::BaseTextEditor *editor, CPlus
Document::Ptr CppRefactoringFile::cppDocument() const
{
if (!m_cppDocument) {
if (!m_cppDocument || !m_cppDocument->translationUnit() ||
!m_cppDocument->translationUnit()->ast()) {
const QString source = document()->toPlainText();
const QString name = fileName();
const Snapshot &snapshot = refactoringChanges()->snapshot();