history.cpp

changeset 153
03a7bdcce50d
parent 146
2ab24976acaa
child 160
edcb03f3ef75
--- a/history.cpp	Fri May 03 18:30:38 2013 +0300
+++ b/history.cpp	Fri May 03 18:49:23 2013 +0300
@@ -97,7 +97,7 @@
 	for (ulong i = 0; i < cache.size(); ++i) {
 		ulong idx = cache.size() - i - 1;
 		LDObject* obj = cache[idx]->clone ();
-		g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + indices[idx], obj);
+		g_CurrentFile->insertObj (indices[idx], obj);
 	}
 	
 	g_ForgeWindow->refresh ();
@@ -217,7 +217,7 @@
 		ulong idx = ulaIndices[i];
 		LDObject* obj = paObjs[i]->clone ();
 		
-		g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + idx, obj);
+		g_CurrentFile->insertObj (idx, obj);
 	}
 	
 	g_ForgeWindow->refresh ();
@@ -258,7 +258,7 @@
 		std::vector<LDTriangle*> paTriangles = pQuad->splitToTriangles ();
 		
 		g_CurrentFile->objects[idx] = paTriangles[0];
-		g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + idx + 1, paTriangles[1]);
+		g_CurrentFile->insertObj (idx + 1, paTriangles[1]);
 		delete pQuad;
 	}
 	
@@ -277,7 +277,7 @@
 	
 	for (ulong i = 0; i < ulaRefIndices.size(); ++i) {
 		LDSubfile* obj = paRefs[i]->clone ();
-		g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + ulaRefIndices[i], obj);
+		g_CurrentFile->insertObj (ulaRefIndices[i], obj);
 	}
 	
 	g_ForgeWindow->refresh ();
@@ -292,7 +292,7 @@
 		vector<LDObject*> objs = ref->inlineContents (bDeep, false);
 		
 		for (LDObject* obj : objs)
-			g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + idx++, obj);
+			g_CurrentFile->insertObj (idx++, obj);
 		
 		g_CurrentFile->forgetObject (ref);
 		delete ref;

mercurial