118 { |
118 { |
119 Model model {m_documents}; |
119 Model model {m_documents}; |
120 m_documents->loadFileContents(&file, model, nullptr, nullptr); |
120 m_documents->loadFileContents(&file, model, nullptr, nullptr); |
121 |
121 |
122 currentDocument()->clearSelection(); |
122 currentDocument()->clearSelection(); |
123 |
123 currentDocument()->merge(model, position, nullptr, [&](LDObject* object, int) |
124 for (LDObject* object : model.objects()) |
|
125 { |
124 { |
126 currentDocument()->insertObject (position, object); |
|
127 currentDocument()->addToSelection(object); |
125 currentDocument()->addToSelection(object); |
128 position++; |
126 }); |
129 } |
|
130 |
|
131 m_window->refresh(); |
127 m_window->refresh(); |
132 m_window->scrollToSelection(); |
128 m_window->scrollToSelection(); |
133 } |
129 } |
134 else |
130 else |
135 { |
131 { |