# HG changeset patch # User Santeri Piippo # Date 1520089143 -7200 # Node ID 0347e9bc883e572defc795cfb7554ac9e900f32b # Parent 0384b1d49786c4692ac2fb60f8707e2ce7d3fbe5 removed LDObject::swap diff -r 0384b1d49786 -r 0347e9bc883e src/editHistory.cpp --- a/src/editHistory.cpp Sat Mar 03 16:56:49 2018 +0200 +++ b/src/editHistory.cpp Sat Mar 03 16:59:03 2018 +0200 @@ -223,7 +223,7 @@ void SwapHistoryEntry::undo() const { - LDObject::fromID (m_a)->swap (LDObject::fromID (m_b)); + parent()->document()->swapObjects(LDObject::fromID (m_a), LDObject::fromID (m_b)); } void SwapHistoryEntry::redo() const diff -r 0384b1d49786 -r 0347e9bc883e src/linetypes/modelobject.cpp --- a/src/linetypes/modelobject.cpp Sat Mar 03 16:56:49 2018 +0200 +++ b/src/linetypes/modelobject.cpp Sat Mar 03 16:59:03 2018 +0200 @@ -110,16 +110,6 @@ return format ("0 BFC %1", statementToString()); } -// ============================================================================= -// -// Swap this object with another. -// -void LDObject::swap (LDObject* other) -{ - if (model() == other->model()) - model()->swapObjects (this, other); -} - int LDObject::triangleCount() const { return 0; diff -r 0384b1d49786 -r 0347e9bc883e src/linetypes/modelobject.h --- a/src/linetypes/modelobject.h Sat Mar 03 16:56:49 2018 +0200 +++ b/src/linetypes/modelobject.h Sat Mar 03 16:59:03 2018 +0200 @@ -80,7 +80,6 @@ void setColor (LDColor color); void setHidden (bool value); void setVertex (int i, const Vertex& vert); - void swap (LDObject* other); bool isInverted() const; void setInverted(bool value); virtual int triangleCount() const; diff -r 0384b1d49786 -r 0347e9bc883e src/toolsets/movetoolset.cpp --- a/src/toolsets/movetoolset.cpp Sat Mar 03 16:56:49 2018 +0200 +++ b/src/toolsets/movetoolset.cpp Sat Mar 03 16:59:03 2018 +0200 @@ -40,7 +40,6 @@ int start = up ? 0 : (countof(objs) - 1); int end = up ? countof(objs) : -1; int increment = up ? 1 : -1; - QSet objsToCompile; Model* model = (*objs.begin())->model(); for (int i = start; i != end; i += increment) @@ -58,9 +57,7 @@ return; } - objsToCompile << obj; - objsToCompile << model->getObject(target); - obj->swap(model->getObject(target)); + model->swapObjects(obj, model->getObject(target)); } }