Permalink
Browse files

Don't paste NULL value when pasting from empty clipboard

When the clipboard is empty and trying to paste from it we would set the
selected field to NULL. This is fixed by this commit, so that nothing
happens.
  • Loading branch information...
MKleusberg committed Dec 4, 2017
1 parent b3a0c57 commit 9db70e07503ffe3ff021087a70b6c32c9bc68c24
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/ExtendedTableWidget.cpp
@@ -32,8 +32,11 @@ QList<QStringList> parseClipboard(QString clipboard)
if(clipboard.endsWith("\r"))
clipboard.chop(1);

// Prepare result list
// Make sure there is some data in the clipboard
QList<QStringList> result;
if(clipboard.isEmpty())
return result;

result.push_back(QStringList());

QRegExp re("(\"(?:[^\t\"]+|\"\"[^\"]*\"\")*)\"|(\t|\r?\n)");

0 comments on commit 9db70e0

Please sign in to comment.