155 if (obj->type() == LDObjectType::SubfileReference) |
155 if (obj->type() == LDObjectType::SubfileReference) |
156 { |
156 { |
157 LDSubfileReference* ref = static_cast<LDSubfileReference*> (obj); |
157 LDSubfileReference* ref = static_cast<LDSubfileReference*> (obj); |
158 Model model {m_documents}; |
158 Model model {m_documents}; |
159 ref->inlineContents(model, true, false); |
159 ref->inlineContents(model, true, false); |
160 writeObjects(model.objects(), f); |
160 writeObjects(model.objects().toQVector(), f); |
161 } |
161 } |
162 else if (obj->type() == LDObjectType::BezierCurve) |
162 else if (obj->type() == LDObjectType::BezierCurve) |
163 { |
163 { |
164 LDBezierCurve* curve = static_cast<LDBezierCurve*> (obj); |
164 LDBezierCurve* curve = static_cast<LDBezierCurve*> (obj); |
165 Model model {m_documents}; |
165 Model model {m_documents}; |
166 curve->rasterize(model, grid()->bezierCurveSegments()); |
166 curve->rasterize(model, grid()->bezierCurveSegments()); |
167 writeObjects(model.objects(), f); |
167 writeObjects(model.objects().toQVector(), f); |
168 } |
168 } |
169 else |
169 else |
170 f.write ((obj->asText() + "\r\n").toUtf8()); |
170 f.write ((obj->asText() + "\r\n").toUtf8()); |
171 } |
171 } |
172 } |
172 } |
319 m_window->deleteSelection(); |
319 m_window->deleteSelection(); |
320 |
320 |
321 for (LDColor color : colorsToReplace) |
321 for (LDColor color : colorsToReplace) |
322 m_window->deleteByColor (color); |
322 m_window->deleteByColor (color); |
323 |
323 |
324 // Insert the new objects |
324 // Insert the new objects. |
325 currentDocument()->clearSelection(); |
325 currentDocument()->clearSelection(); |
326 |
326 currentDocument()->merge(model, -1, [](LDObject* object) {return object->isScemantic();}); |
327 for (LDObject* object : model.objects()) |
|
328 { |
|
329 if (object->isScemantic()) |
|
330 currentDocument()->addObject(object); |
|
331 } |
|
332 |
|
333 m_window->doFullRefresh(); |
327 m_window->doFullRefresh(); |
334 } |
328 } |
335 |
329 |
336 // ============================================================================= |
330 // ============================================================================= |
337 // Interface for Ytruder |
331 // Interface for Ytruder |