-rw-r--r-- | core/apps/textedit/textedit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 797c61b..5edf102 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -1173,9 +1173,10 @@ if(featureAutoSave) } } void TextEdit::gotoLine() { - + if( editor->length() < 1) + return; QWidget *d = QApplication::desktop(); gotoEdit = new QLineEdit( 0, "Goto line"); gotoEdit->move( (d->width()/2) - ( gotoEdit->width()/2) , (d->height()/2) - (gotoEdit->height()/2)); @@ -1186,8 +1187,9 @@ void TextEdit::gotoLine() { void TextEdit::doGoto() { QString number = gotoEdit->text(); gotoEdit->hide(); + if(gotoEdit) { delete gotoEdit; gotoEdit = 0; } |