Editors: Refactor indenters out of the editors for better reusability.

Reviewed-by: ckamm
This commit is contained in:
Leandro Melo
2010-11-05 14:27:16 +01:00
parent 1afea78c7d
commit 3a684586fa
19 changed files with 455 additions and 170 deletions

View File

@@ -29,6 +29,7 @@
#include "normalindenter.h"
#include "tabsettings.h"
#include "basetexteditor.h"
#include <QtGui/QTextDocument>
@@ -60,9 +61,9 @@ NormalIndenter::~NormalIndenter()
// to do in 2 steps (indenting/wrapping)}
//
void NormalIndenter::doIndentBlock(QTextDocument *doc,
QTextBlock block,
QChar typedChar,
const TextEditor::TabSettings &ts)
const QTextBlock &block,
const QChar &typedChar,
BaseTextEditor *editor)
{
Q_UNUSED(typedChar)
@@ -78,6 +79,7 @@ void NormalIndenter::doIndentBlock(QTextDocument *doc,
// Just use previous line.
// Skip blank characters when determining the indentation
const TabSettings &ts = editor->tabSettings();
int i = 0;
while (i < previousText.size()) {
if (!previousText.at(i).isSpace()) {