src/ldtypes.cpp

changeset 500
cad8cdc42a64
parent 498
791c831c8020
child 503
bebe09014dd6
equal deleted inserted replaced
499:ebd30d9eb667 500:cad8cdc42a64
228 // ============================================================================= 228 // =============================================================================
229 // ----------------------------------------------------------------------------- 229 // -----------------------------------------------------------------------------
230 void LDObject::swap (LDObject* other) 230 void LDObject::swap (LDObject* other)
231 { int i = 0; 231 { int i = 0;
232 232
233 for (LDObject * obj : file()->objects()) 233 for (LDObject* obj : file()->objects())
234 { if (obj == this) 234 { if (obj == this)
235 file()->setObject (i, other); 235 file()->setObject (i, other);
236
237 elif (obj == other) 236 elif (obj == other)
238 file()->setObject (i, this); 237 file()->setObject (i, this);
239 238
240 ++i; 239 ++i;
241 } 240 }
242 241
243 file()->addToHistory (new SwapHistory (id(), other->id())); 242 file()->addToHistory (new SwapHistory (id(), other->id()));

mercurial