Tue, 28 Sep 2021 22:17:52 +0300
Fix handling of "BFC INVERTNEXT" with multiple inner whitespaces
src/parser.cpp | file | annotate | diff | comparison | revisions |
--- a/src/parser.cpp Tue Sep 28 22:14:00 2021 +0300 +++ b/src/parser.cpp Tue Sep 28 22:17:52 2021 +0300 @@ -240,7 +240,10 @@ this->bag.append(this->readLine()); for (const QString& line : this->bag) { - if (line == "0 BFC INVERTNEXT" or line == "0 BFC CERTIFY INVERTNEXT") + // Some LDraw parts such as 53588.dat can contain "BFC INVERTNEXT" with multiple inner whitespaces. + // So we need to pass the string through QString::simplified to catch these cases. + const QString simplifiedLine = line.simplified(); + if (simplifiedLine == "0 BFC INVERTNEXT" or simplifiedLine == "0 BFC CERTIFY INVERTNEXT") { invertNext = true; continue;