forked from qt-creator/qt-creator
TextEditor: Shuffle some convenience functions
Remove rarely used ones, add a currentTextEditorWidget() Change-Id: I27b97c17927c71e07dc3b489785b7f2f76eb801e Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -114,11 +114,11 @@ void ClangFormat::formatFile()
|
||||
|
||||
void ClangFormat::formatSelectedText()
|
||||
{
|
||||
TextEditor::BaseTextEditor *editor = TextEditor::BaseTextEditor::currentTextEditor();
|
||||
if (!editor)
|
||||
TextEditor::TextEditorWidget *widget = TextEditor::TextEditorWidget::currentTextEditorWidget();
|
||||
if (!widget)
|
||||
return;
|
||||
|
||||
QTextCursor tc = editor->textCursor();
|
||||
QTextCursor tc = widget->textCursor();
|
||||
if (tc.hasSelection()) {
|
||||
const int offset = tc.selectionStart();
|
||||
const int length = tc.selectionEnd() - offset;
|
||||
|
||||
Reference in New Issue
Block a user