src/parser.cpp

changeset 144
5d73a6717321
parent 141
185eb297dc1e
child 152
03f8e6d42e13
--- 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;

mercurial