TextEditor: Consolidate document access functions.

There was document(), textDocument() and baseTextDocument().
Two should be enough...

Change-Id: Id9e41c8d857c5cb3269a9fce5ab594d34448c982
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
hjk
2014-08-01 23:31:56 +02:00
committed by Tobias Hunger
parent a9b7045803
commit d7c2b0b681
54 changed files with 154 additions and 161 deletions

View File

@@ -465,7 +465,7 @@ void CppCodeStylePreferencesWidget::updatePreview()
const TextEditor::TabSettings ts = cppCodeStylePreferences->currentTabSettings();
QtStyleCodeFormatter formatter(ts, ccss);
foreach (TextEditor::SnippetEditorWidget *preview, m_previews) {
preview->baseTextDocument()->setTabSettings(ts);
preview->textDocument()->setTabSettings(ts);
preview->setCodeStyle(cppCodeStylePreferences);
QTextDocument *doc = preview->document();
@@ -475,7 +475,7 @@ void CppCodeStylePreferencesWidget::updatePreview()
QTextCursor tc = preview->textCursor();
tc.beginEditBlock();
while (block.isValid()) {
preview->baseTextDocument()->indenter()->indentBlock(doc, block, QChar::Null, ts);
preview->textDocument()->indenter()->indentBlock(doc, block, QChar::Null, ts);
block = block.next();
}
@@ -492,7 +492,7 @@ void CppCodeStylePreferencesWidget::decorateEditors(const TextEditor::FontSettin
});
foreach (TextEditor::SnippetEditorWidget *editor, m_previews) {
editor->baseTextDocument()->setFontSettings(fontSettings);
editor->textDocument()->setFontSettings(fontSettings);
if (provider)
provider->decorateEditor(editor);
}

View File

@@ -103,7 +103,7 @@ public:
QStringList completions;
CppCompletionAssistInterface *ai
= new CppCompletionAssistInterface(m_editorWidget->document(), m_position,
m_editorWidget->baseTextDocument()->filePath(),
m_editorWidget->textDocument()->filePath(),
ExplicitlyInvoked, m_snapshot,
ProjectPart::HeaderPaths());
CppCompletionAssistProcessor processor;

View File

@@ -121,7 +121,7 @@ CppEditorSupport::CppEditorSupport(CppModelManager *modelManager, BaseTextEditor
, m_initialized(false)
, m_lastHighlightRevision(0)
, m_lastHighlightOnCompleteSemanticInfo(true)
, m_highlightingSupport(modelManager->highlightingSupport(textEditor->baseTextDocument()))
, m_highlightingSupport(modelManager->highlightingSupport(textEditor->textDocument()))
, m_completionAssistProvider(
modelManager->completionAssistProvider(textEditor->document()->mimeType()))
{