src/toolsets/filetoolset.cpp

changeset 1186
eae8b3bce545
parent 1164
eabcd749759a
child 1192
317f4ce38f3f
--- a/src/toolsets/filetoolset.cpp	Sun Mar 05 13:33:37 2017 +0200
+++ b/src/toolsets/filetoolset.cpp	Sun Mar 05 16:47:52 2017 +0200
@@ -120,14 +120,10 @@
 			m_documents->loadFileContents(&file, model, nullptr, nullptr);
 
 			currentDocument()->clearSelection();
-
-			for (LDObject* object : model.objects())
+			currentDocument()->merge(model, position, nullptr, [&](LDObject* object, int)
 			{
-				currentDocument()->insertObject (position, object);
 				currentDocument()->addToSelection(object);
-				position++;
-			}
-
+			});
 			m_window->refresh();
 			m_window->scrollToSelection();
 		}

mercurial