src/toolsets/movetoolset.cpp

changeset 1272
bf0ac547b934
parent 1270
6af79c9eb274
child 1273
900f1dfae46b
--- a/src/toolsets/movetoolset.cpp	Mon Mar 05 22:44:48 2018 +0200
+++ b/src/toolsets/movetoolset.cpp	Mon Mar 05 23:59:47 2018 +0200
@@ -45,10 +45,10 @@
 	{
 		LDObject* obj = objs[i];
 
-		int idx = currentDocument()->indexOf(obj).row();
-		int target = idx + (up ? -1 : 1);
+		QModelIndex index = currentDocument()->indexOf(obj);
+		int target = index.row() + (up ? -1 : 1);
 
-		if ((up and idx == 0) or (not up and idx == countof(currentDocument()->objects()) - 1))
+		if ((up and index.row() == 0) or (not up and index.row() == countof(currentDocument()->objects()) - 1))
 		{
 			// One of the objects hit the extrema. If this happens, this should be the first
 			// object to be iterated on. Thus, nothing has changed yet and it's safe to just
@@ -56,7 +56,7 @@
 			return;
 		}
 
-		currentDocument()->swapObjects(obj, currentDocument()->getObject(target));
+		currentDocument()->swapObjects(index, currentDocument()->index(target));
 	}
 }
 

mercurial