188 // ============================================================================= |
188 // ============================================================================= |
189 // ----------------------------------------------------------------------------- |
189 // ----------------------------------------------------------------------------- |
190 void writeColorGroup (const int colnum, str fname) |
190 void writeColorGroup (const int colnum, str fname) |
191 { QList<LDObject*> objects; |
191 { QList<LDObject*> objects; |
192 |
192 |
193 for (LDObject* obj : LDFile::current()->getObjects()) |
193 for (LDObject* obj : getCurrentDocument()->getObjects()) |
194 { if (obj->isColored() == false || obj->getColor() != colnum) |
194 { if (obj->isColored() == false || obj->getColor() != colnum) |
195 continue; |
195 continue; |
196 |
196 |
197 objects << obj; |
197 objects << obj; |
198 } |
198 } |
276 |
276 |
277 for (const int colnum : colorsToReplace) |
277 for (const int colnum : colorsToReplace) |
278 g_win->deleteByColor (colnum); |
278 g_win->deleteByColor (colnum); |
279 |
279 |
280 // Insert the new objects |
280 // Insert the new objects |
281 LDFile::current()->clearSelection(); |
281 getCurrentDocument()->clearSelection(); |
282 |
282 |
283 for (LDObject * obj : objs) |
283 for (LDObject * obj : objs) |
284 { if (!obj->isScemantic()) |
284 { if (!obj->isScemantic()) |
285 { delete obj; |
285 { delete obj; |
286 continue; |
286 continue; |
287 } |
287 } |
288 |
288 |
289 LDFile::current()->addObject (obj); |
289 getCurrentDocument()->addObject (obj); |
290 obj->select(); |
290 obj->select(); |
291 } |
291 } |
292 |
292 |
293 g_win->doFullRefresh(); |
293 g_win->doFullRefresh(); |
294 } |
294 } |