From 64423f1852a13178f23365f2bba995ef2c355b3b Mon Sep 17 00:00:00 2001 From: llornkcor Date: Fri, 28 Feb 2003 18:13:41 +0000 Subject: no goto for 0 length texts --- 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 @@ -1174,7 +1174,8 @@ if(featureAutoSave) } void TextEdit::gotoLine() { - + if( editor->length() < 1) + return; QWidget *d = QApplication::desktop(); gotoEdit = new QLineEdit( 0, "Goto line"); @@ -1187,6 +1188,7 @@ void TextEdit::gotoLine() { void TextEdit::doGoto() { QString number = gotoEdit->text(); gotoEdit->hide(); + if(gotoEdit) { delete gotoEdit; gotoEdit = 0; @@ -1194,7 +1196,7 @@ void TextEdit::doGoto() { bool ok; int lineNumber = number.toInt(&ok, 10); - if(editor->numLines() < lineNumber) + if( editor->numLines() < lineNumber) QMessageBox::message(tr("Text Edit"),tr("Not enough lines")); else { -- cgit v0.9.0.2