TextEditors: Move some auto-indentation code to document

From the editor widget. Also name them autoIndent/autoReindent to
distinguish from the manual indent functions.

Change-Id: I4e1b9d503f53870b669fee66467e5e567eacefec
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2014-01-15 17:09:52 +01:00
parent 7422b47942
commit 8aedff7f22
7 changed files with 29 additions and 35 deletions

View File

@@ -309,7 +309,7 @@ static void addDeclaration(const Snapshot &snapshot,
tc.beginEditBlock();
tc.insertText(loc.prefix() + declaration + loc.suffix());
tc.setPosition(pos, QTextCursor::KeepAnchor);
editor->indentInsertedText(tc);
editor->baseTextDocument()->autoIndent(tc);
tc.endEditBlock();
}
}