src/ldDocument.cc

changeset 733
cc39df788660
parent 719
f2cc5964f52d
child 734
cdce1cbaac7e
--- a/src/ldDocument.cc	Wed Apr 23 15:39:42 2014 +0300
+++ b/src/ldDocument.cc	Wed Apr 23 18:25:09 2014 +0300
@@ -819,10 +819,7 @@
 static Vertex parseVertex (QStringList& s, const int n)
 {
 	Vertex v;
-
-	for_axes (ax)
-		v[ax] = s[n + ax].toDouble();
-
+	v.apply ([&] (Axis ax, double& a) { a = s[n + ax].toDouble(); });
 	return v;
 }
 
@@ -892,10 +889,7 @@
 
 						LDVertex* obj = new LDVertex;
 						obj->setColor (tokens[3].toLong());
-
-						for_axes (ax)
-							obj->pos[ax] = tokens[4 + ax].toDouble(); // 4 - 6
-
+						obj->pos.apply ([&](Axis ax, double& value) { value = tokens[4 + ax].toDouble(); });
 						return obj;
 					} elif (tokens[2] == "OVERLAY")
 					{

mercurial