Skip to content

Commit

Permalink
Fix behaviour of StringHandler::getStrings (#8028)
Browse files Browse the repository at this point in the history
- Preserve the old behaviour of StringHandler::getStrings by appending
  an empty string to the list if the string to split ends with a comma.
  • Loading branch information
perost committed Oct 20, 2021
1 parent 7fd3c06 commit 75b740d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OMEdit/OMEditLIB/Util/StringHandler.cpp
Expand Up @@ -948,7 +948,11 @@ QStringList StringHandler::getStrings(QString value)
}

if (n > 0) {
// Append the rest of the string if there's anything left.
res.append(value.mid(start).trimmed());
} else if (!value.isEmpty() && value[value.size()-1] == ',') {
// Append an empty string if the string ends with ,
res.append(QString());
}

return res;
Expand Down

0 comments on commit 75b740d

Please sign in to comment.