src/toolsets/viewtoolset.cpp

changeset 1031
55c0d3beea0d
parent 1017
fc1c13db9618
child 1033
32153a1dbb15
--- a/src/toolsets/viewtoolset.cpp	Wed Feb 17 03:24:07 2016 +0200
+++ b/src/toolsets/viewtoolset.cpp	Wed Feb 17 19:54:21 2016 +0200
@@ -43,7 +43,7 @@
 	if (selectedObjects().isEmpty())
 		return;
 
-	QList<LDColor> colors;
+	QSet<LDColor> colors;
 
 	for (LDObject* obj : selectedObjects())
 	{
@@ -51,7 +51,6 @@
 			colors << obj->color();
 	}
 
-	removeDuplicates (colors);
 	currentDocument()->clearSelection();
 
 	for (LDObject* obj : currentDocument()->objects())
@@ -66,19 +65,17 @@
 	if (selectedObjects().isEmpty())
 		return;
 
-	QList<LDObjectType> types;
-	QStringList subfilenames;
+	QSet<LDObjectType> types;
+	QSet<QString> subfilenames;
 
 	for (LDObject* obj : selectedObjects())
 	{
 		types << obj->type();
 
-		if (types.last() == OBJ_SubfileReference)
+		if (obj->type() == OBJ_SubfileReference)
 			subfilenames << static_cast<LDSubfileReference*> (obj)->fileInfo()->name();
 	}
 
-	removeDuplicates (types);
-	removeDuplicates (subfilenames);
 	currentDocument()->clearSelection();
 
 	for (LDObject* obj : currentDocument()->objects())

mercurial