CppTools: CppHighlightingSupport takes a BaseTextDocument

...instead an ITextEditor.

The ITextEditor was only used to access the file path and QTextDocument
via the BaseTextEditorWidget.

Change-Id: Idef2b8162b992fe3718e16e2a046e2ff214846f2
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-06-06 11:52:09 -04:00
parent fc7f5ba364
commit a6e04c363f
15 changed files with 53 additions and 45 deletions

View File

@@ -895,15 +895,13 @@ CppCompletionAssistProvider *CppModelManager::completionAssistProvider(const QSt
return cms->completionAssistProvider();
}
CppHighlightingSupport *CppModelManager::highlightingSupport(Core::IEditor *editor) const
CppHighlightingSupport *CppModelManager::highlightingSupport(
TextEditor::BaseTextDocument *baseTextDocument) const
{
TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor);
if (!textEditor)
return 0;
ModelManagerSupport *cms = modelManagerSupportForMimeType(editor->document()->mimeType());
return cms->highlightingSupport(textEditor);
QTC_ASSERT(baseTextDocument, return 0);
ModelManagerSupport *cms = modelManagerSupportForMimeType(baseTextDocument->mimeType());
QTC_ASSERT(cms, return 0);
return cms->highlightingSupport(baseTextDocument);
}
void CppModelManager::setIndexingSupport(CppIndexingSupport *indexingSupport)