src/extprogs.cpp

changeset 553
2418d5955421
parent 541
0e38beeb050a
equal deleted inserted replaced
552:454f8b730946 553:2418d5955421
26 #include <QGridLayout> 26 #include <QGridLayout>
27 #include "main.h" 27 #include "main.h"
28 #include "config.h" 28 #include "config.h"
29 #include "misc.h" 29 #include "misc.h"
30 #include "gui.h" 30 #include "gui.h"
31 #include "file.h" 31 #include "document.h"
32 #include "widgets.h" 32 #include "widgets.h"
33 #include "history.h" 33 #include "history.h"
34 #include "ui_ytruder.h" 34 #include "ui_ytruder.h"
35 #include "ui_intersector.h" 35 #include "ui_intersector.h"
36 #include "ui_rectifier.h" 36 #include "ui_rectifier.h"
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 }

mercurial