SqlExecutionArea: Replace UTF8 paragraph separator by newline char

When the user selects multiple lines of SQL code and hits F5 to execute
them the execution stops after the first line because we use the
selectedText() method of the QTextCursor class to get the selected text
and this method returns Unicode U+2029 paragraph separator characters
instead of newline \n characters.
(see http://qt-project.org/doc/qt-4.8/qtextcursor.html#selectedText)
Fix this by replacing these by regular newline characters to.
This commit is contained in:
Martin Kleusberg
2014-02-10 13:56:22 +01:00
parent 6ab8cf3dd3
commit 35c571ba7b

View File

@@ -51,7 +51,7 @@ QString SqlExecutionArea::getSql() const
QString SqlExecutionArea::getSelectedSql() const
{
return ui->editEditor->textCursor().selectedText().trimmed();
return ui->editEditor->textCursor().selectedText().trimmed().replace(QChar(0x2029), '\n');
}
void SqlExecutionArea::finishExecution(const QString& result)