src/ldObject.cpp

changeset 1081
47cde4087cc5
parent 1080
6dac2d52bd9a
child 1082
1738bdaf36d6
--- a/src/ldObject.cpp	Sun Jan 29 21:07:15 2017 +0200
+++ b/src/ldObject.cpp	Sun Jan 29 21:17:43 2017 +0200
@@ -603,7 +603,7 @@
 	}
 
 	// Not inverted, thus prefix it with a new invertnext.
-	this->model()->insertObject (idx, new LDBfc (BfcStatement::InvertNext));
+	this->model()->emplaceAt<LDBfc>(idx, BfcStatement::InvertNext);
 }
 
 // =============================================================================
@@ -643,13 +643,12 @@
 //
 LDLine* LDCondLine::becomeEdgeLine()
 {
-	LDLine* replacement = new LDLine;
+	LDLine* replacement = model()->emplaceReplacement<LDLine>(this);
 
 	for (int i = 0; i < replacement->numVertices(); ++i)
 		replacement->setVertex (i, vertex (i));
 
 	replacement->setColor (color());
-	model()->replace(this, replacement);
 	return replacement;
 }
 

mercurial