src/gui_editactions.cpp

changeset 498
791c831c8020
parent 493
16766ac1bbd9
child 504
6a1fa662bfc1
equal deleted inserted replaced
497:c51941e590b6 498:791c831c8020
79 79
80 // ============================================================================= 80 // =============================================================================
81 // ----------------------------------------------------------------------------- 81 // -----------------------------------------------------------------------------
82 DEFINE_ACTION (Paste, CTRL (V)) 82 DEFINE_ACTION (Paste, CTRL (V))
83 { const str clipboardText = qApp->clipboard()->text(); 83 { const str clipboardText = qApp->clipboard()->text();
84 ulong idx = g_win->getInsertionPoint(); 84 int idx = g_win->getInsertionPoint();
85 g_win->sel().clear(); 85 g_win->sel().clear();
86 int num = 0; 86 int num = 0;
87 87
88 for (str line : clipboardText.split ("\n")) 88 for (str line : clipboardText.split ("\n"))
89 { LDObject* pasted = parseLine (line); 89 { LDObject* pasted = parseLine (line);
308 308
309 for (LDObject* obj : g_win->sel()) 309 for (LDObject* obj : g_win->sel())
310 { if (obj->vertices() < 2) 310 { if (obj->vertices() < 2)
311 continue; 311 continue;
312 312
313 ulong idx = obj->getIndex(); 313 int idx = obj->getIndex();
314 314
315 for (short i = 0; i < obj->vertices(); ++i) 315 for (int i = 0; i < obj->vertices(); ++i)
316 { LDVertex* vert = new LDVertex; 316 { LDVertex* vert = new LDVertex;
317 vert->pos = obj->getVertex (i); 317 vert->pos = obj->getVertex (i);
318 vert->setColor (obj->color()); 318 vert->setColor (obj->color());
319 319
320 LDFile::current()->insertObj (++idx, vert); 320 LDFile::current()->insertObj (++idx, vert);

mercurial