diff --git a/src/ExtendedTableWidget.cpp b/src/ExtendedTableWidget.cpp index 270acef5..caab1138 100644 --- a/src/ExtendedTableWidget.cpp +++ b/src/ExtendedTableWidget.cpp @@ -322,7 +322,7 @@ void ExtendedTableWidget::copy(const bool withHeaders, const bool inSQL ) const QString fieldSepText = "\t"; const QString rowSepText = "\r\n"; - QString sqlInsertStatement = QString("INSERT INTO \"%1\" ( '").arg(m->currentTableName().toString()); + QString sqlInsertStatement = QString("INSERT INTO %1 ( '").arg(sqlb::escapeIdentifier(m->currentTableName().toString())); // Table headers if (withHeaders || inSQL) { htmlResult.append(""); @@ -377,7 +377,7 @@ void ExtendedTableWidget::copy(const bool withHeaders, const bool inSQL ) htmlResult.append("\"Image\""); } else { QByteArray text; @@ -397,11 +397,11 @@ void ExtendedTableWidget::copy(const bool withHeaders, const bool inSQL ) sqlResult.append("\");"); QMimeData *mimeData = new QMimeData; - mimeData->setHtml(htmlResult + ""); if ( inSQL ) { mimeData->setText(sqlResult); } else { + mimeData->setHtml(htmlResult + ""); mimeData->setText(result); } qApp->clipboard()->setMimeData(mimeData);