src/gui_editactions.cpp

changeset 252
3f9067022d74
parent 251
c4b96bc41298
child 253
0737c217a54d
--- a/src/gui_editactions.cpp	Fri May 24 15:23:56 2013 +0300
+++ b/src/gui_editactions.cpp	Fri May 24 15:38:23 2013 +0300
@@ -57,7 +57,7 @@
 	// the clipboard. Thus, we add clones of the objects to the clipboard, not
 	// the objects themselves.
 	for (ulong i = 0; i < objs.size(); ++i)
-		g_Clipboard.push_back (objs[i]->clone ());
+		g_Clipboard << objs[i]->clone ();
 	
 	return true;
 }
@@ -94,12 +94,12 @@
 	g_win->sel ().clear ();
 	
 	for (LDObject* obj : g_Clipboard) {
-		historyIndices.push_back (idx);
-		historyCopies.push_back (obj->clone ());
+		historyIndices << idx;
+		historyCopies << obj->clone ();
 		
 		LDObject* copy = obj->clone ();
 		g_curfile->insertObj (idx++, copy);
-		g_win->sel ().push_back (copy);
+		g_win->sel () << copy;
 	}
 	
 	History::addEntry (new AddHistory (historyIndices, historyCopies, AddHistory::Paste));
@@ -134,8 +134,8 @@
 		if (obj->getType() != LDObject::Subfile)
 			continue;
 		
-		refIndices.push_back (obj->getIndex (g_curfile));
-		refs.push_back (static_cast<LDSubfile*> (obj)->clone ());
+		refIndices << obj->getIndex (g_curfile);
+		refs << static_cast<LDSubfile*> (obj)->clone ();
 	}
 	
 	for (LDObject* obj : sel) {
@@ -156,7 +156,7 @@
 		
 		// Merge in the inlined objects
 		for (LDObject* inlineobj : objs) {
-			bitIndices.push_back (idx);
+			bitIndices << idx;
 			
 			// This object is now inlined so it has no parent anymore.
 			inlineobj->parent = null;
@@ -200,7 +200,7 @@
 		
 		LDOpenFile* file = loadSubfile (name);
 		if (file == null) {
-			fails.push_back (name);
+			fails << name;
 			continue;
 		}
 		
@@ -247,8 +247,8 @@
 		if (obj->getType() != LDObject::Quad)
 			continue;
 		
-		ulaIndices.push_back (obj->getIndex (g_curfile));
-		paCopies.push_back (static_cast<LDQuad*> (obj)->clone ());
+		ulaIndices << obj->getIndex (g_curfile);
+		paCopies << static_cast<LDQuad*> (obj)->clone ();
 	}
 	
 	for (LDObject* obj : objs) {
@@ -332,8 +332,8 @@
 			if (obj->isColored () == false)
 				continue;
 			
-			indices.push_back (obj->getIndex (g_curfile));
-			colornums.push_back (obj->color);
+			indices << obj->getIndex (g_curfile);
+			colornums << obj->color;
 			
 			obj->color = colnum;
 			g_win->R ()->compileObject (obj);
@@ -382,8 +382,8 @@
 			lines[i]->color = edgecolor;
 			g_curfile->insertObj (idx, lines[i]);
 			
-			historyIndices.push_back (idx);
-			historyObjs.push_back (lines[i]->clone ());
+			historyIndices << idx;
+			historyObjs << lines[i]->clone ();
 			g_win->R ()->compileObject (lines[i]);
 		}
 	}
@@ -412,8 +412,8 @@
 			vert->color = obj->color;
 			
 			g_curfile->insertObj (++idx, vert);
-			ulaIndices.push_back (idx);
-			paObjs.push_back (vert->clone ());
+			ulaIndices << idx;
+			paObjs << vert->clone ();
 			g_win->R ()->compileObject (vert);
 		}
 	}
@@ -433,7 +433,7 @@
 	// Get the indices of the objects for history archival
 	vector<ulong> ulaIndices;
 	for (LDObject* obj : objs)
-		ulaIndices.push_back (obj->getIndex (g_curfile));
+		ulaIndices << obj->getIndex (g_curfile);
 	
 	LDObject::moveObjects (objs, bUp);
 	History::addEntry (new ListMoveHistory (ulaIndices, bUp));
@@ -476,7 +476,7 @@
 	vVector[Z] *= currentGrid ().confs[Grid::Z]->value;
 	
 	for (LDObject* obj : g_win->sel ()) {
-		ulaIndices.push_back (obj->getIndex (g_curfile));
+		ulaIndices << obj->getIndex (g_curfile);
 		obj->move (vVector);
 		g_win->R ()->compileObject (obj);
 	}
@@ -570,14 +570,14 @@
 	for (LDObject* obj : sel) {
 		if (obj->vertices ())
 			for (short i = 0; i < obj->vertices (); ++i)
-				queue.push_back (&obj->coords[i]);
+				queue << &obj->coords[i];
 		else if (obj->hasMatrix ()) {
 			LDMatrixObject* mobj = static_cast<LDSubfile*> (obj);
 			
-			queue.push_back (&mobj->pos);
+			queue << &mobj->pos;
 			mobj->transform = mobj->transform * transform;
 		} else if (obj->getType () == LDObject::Vertex)
-			queue.push_back (&static_cast<LDVertex*> (obj)->pos);
+			queue << &static_cast<LDVertex*> (obj)->pos;
 		
 		g_win->R ()->compileObject (obj);
 	}
@@ -645,11 +645,11 @@
 		if (obj->isColored () == false)
 			continue;
 		
-		indices.push_back (obj->getIndex (g_curfile));
-		oldCopies.push_back (obj->clone ());
+		indices << obj->getIndex (g_curfile);
+		oldCopies << obj->clone ();
 		
 		obj->color = (obj->getType () == LDObject::Line || obj->getType () == LDObject::CondLine) ? edgecolor : maincolor;
-		newCopies.push_back (obj->clone ());
+		newCopies << obj->clone ();
 	}
 	
 	if (indices.size () > 0) {
@@ -811,8 +811,8 @@
 		if (obj->isColored () == false)
 			continue;
 		
-		indices.push_back (obj->getIndex (g_curfile));
-		colors.push_back (obj->color);
+		indices << obj->getIndex (g_curfile);
+		colors << obj->color;
 		
 		obj->color = colnum;
 		g_win->R ()->compileObject (obj);

mercurial