Reverted a change which introduced a duplicate action for

(re-)formatting.
This commit is contained in:
Erik Verbruggen
2009-09-25 10:47:04 +02:00
parent 20b9258d9e
commit 91a492a562
7 changed files with 1 additions and 52 deletions

View File

@@ -3307,10 +3307,6 @@ void BaseTextEditor::indentBlock(QTextDocument *, QTextBlock, QChar)
{
}
void BaseTextEditor::reformatBlock(QTextDocument *, QTextBlock)
{
}
void BaseTextEditor::indent(QTextDocument *doc, const QTextCursor &cursor, QChar typedChar)
{
if (cursor.hasSelection()) {
@@ -3325,20 +3321,6 @@ void BaseTextEditor::indent(QTextDocument *doc, const QTextCursor &cursor, QChar
}
}
void BaseTextEditor::reformat(QTextDocument *doc, const QTextCursor &cursor)
{
if (cursor.hasSelection()) {
QTextBlock block = doc->findBlock(qMin(cursor.selectionStart(), cursor.selectionEnd()));
const QTextBlock end = doc->findBlock(qMax(cursor.selectionStart(), cursor.selectionEnd())).next();
do {
reformatBlock(doc, block);
block = block.next();
} while (block.isValid() && block != end);
} else {
reformatBlock(doc, cursor.block());
}
}
BaseTextEditor::Link BaseTextEditor::findLinkAt(const QTextCursor &, bool)
{
return Link();
@@ -4074,14 +4056,6 @@ void BaseTextEditor::format()
cursor.endEditBlock();
}
void BaseTextEditor::reformat()
{
QTextCursor cursor = textCursor();
cursor.beginEditBlock();
reformat(document(), cursor);
cursor.endEditBlock();
}
void BaseTextEditor::rewrapParagraph()
{
const int paragraphWidth = displaySettings().m_wrapColumn;