src/toolsets/extprogramtoolset.cpp

changeset 978
4603d8fd063e
parent 974
b2fa5f89798a
child 984
a7b6f987d269
equal deleted inserted replaced
977:dc3ceb65cda7 978:4603d8fd063e
203 203
204 // ============================================================================= 204 // =============================================================================
205 // 205 //
206 void ExtProgramToolset::writeSelection (QString fname) 206 void ExtProgramToolset::writeSelection (QString fname)
207 { 207 {
208 writeObjects (Selection(), fname); 208 writeObjects (selectedObjects(), fname);
209 } 209 }
210 210
211 // ============================================================================= 211 // =============================================================================
212 // 212 //
213 void ExtProgramToolset::writeColorGroup (LDColor color, QString fname) 213 void ExtProgramToolset::writeColorGroup (LDColor color, QString fname)
214 { 214 {
215 LDObjectList objects; 215 LDObjectList objects;
216 216
217 for (LDObject* obj : CurrentDocument()->objects()) 217 for (LDObject* obj : currentDocument()->objects())
218 { 218 {
219 if (not obj->isColored() or obj->color() != color) 219 if (not obj->isColored() or obj->color() != color)
220 continue; 220 continue;
221 221
222 objects << obj; 222 objects << obj;
323 323
324 for (LDColor color : colorsToReplace) 324 for (LDColor color : colorsToReplace)
325 m_window->deleteByColor (color); 325 m_window->deleteByColor (color);
326 326
327 // Insert the new objects 327 // Insert the new objects
328 CurrentDocument()->clearSelection(); 328 currentDocument()->clearSelection();
329 329
330 for (LDObject* obj : objs) 330 for (LDObject* obj : objs)
331 { 331 {
332 if (not obj->isScemantic()) 332 if (not obj->isScemantic())
333 { 333 {
334 obj->destroy(); 334 obj->destroy();
335 continue; 335 continue;
336 } 336 }
337 337
338 CurrentDocument()->addObject (obj); 338 currentDocument()->addObject (obj);
339 obj->select(); 339 obj->select();
340 } 340 }
341 341
342 m_window->doFullRefresh(); 342 m_window->doFullRefresh();
343 } 343 }

mercurial