forked from qt-creator/qt-creator
Reverted a change which introduced a duplicate action for
(re-)formatting.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user