Fix blank line between comments issue (#3407)

* Added failing test to demonstrate issue with dec loading

* Prevents empty lines between comments from being interpreted as the start of the sideboard
This commit is contained in:
Dane Johnson 2018-10-08 10:26:08 -05:00 committed by Zach H
parent cf9fdcd09e
commit bc2cb59c50
2 changed files with 18 additions and 2 deletions

View file

@ -542,10 +542,11 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
}
// If we have a blank line and it's the _ONLY_ blank line in the paste
// and it follows at least one valid card
// Then we assume it means to start the sideboard section of the paste.
// If we have the word "Sideboard" appear on any line, then that will
// also indicate the start of the sideboard.
if ((line.isEmpty() && blankLines == 1) || line.startsWith("sideboard")) {
if ((line.isEmpty() && blankLines == 1 && okRows > 0) || line.startsWith("sideboard")) {
inSideboard = true;
continue; // The line isn't actually a card
}