[qet] [2459] replace & by ==, to better handle content

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2459
Author:   blacksun
Date:     2013-08-25 13:55:23 +0200 (Sun, 25 Aug 2013)
Log Message:
-----------
replace & by ==, to better handle content

Modified Paths:
--------------
    trunk/sources/diagramcontent.cpp

Modified: trunk/sources/diagramcontent.cpp
===================================================================
--- trunk/sources/diagramcontent.cpp	2013-08-25 10:38:26 UTC (rev 2458)
+++ trunk/sources/diagramcontent.cpp	2013-08-25 11:55:23 UTC (rev 2459)
@@ -100,20 +100,20 @@
 */
 int DiagramContent::count(int filter) const {
 	int count = 0;
-	if (filter & SelectedOnly) {
-		if (filter & Elements)           foreach(Element *element,     elements)                  { if (element   -> isSelected()) ++ count; }
-		if (filter & TextFields)         foreach(DiagramTextItem *dti, textFields)                { if (dti       -> isSelected()) ++ count; }
-		if (filter & Images)			 foreach(DiagramImageItem *dii, images)					  { if (dii		  -> isSelected()) ++ count; }
-		if (filter & ConductorsToMove)   foreach(Conductor *conductor, conductorsToMove)          { if (conductor -> isSelected()) ++ count; }
-		if (filter & ConductorsToUpdate) foreach(Conductor *conductor, conductorsToUpdate)        { if (conductor -> isSelected()) ++ count; }
-		if (filter & OtherConductors)    foreach(Conductor *conductor, otherConductors)           { if (conductor -> isSelected()) ++ count; }
+	if (filter == SelectedOnly) {
+		if (filter == Elements)           foreach(Element *element,     elements)                  { if (element   -> isSelected()) ++ count; }
+		if (filter == TextFields)         foreach(DiagramTextItem *dti, textFields)                { if (dti       -> isSelected()) ++ count; }
+		if (filter == Images)			  foreach(DiagramImageItem *dii, images)				   { if (dii	   -> isSelected()) ++ count; }
+		if (filter == ConductorsToMove)   foreach(Conductor *conductor, conductorsToMove)          { if (conductor -> isSelected()) ++ count; }
+		if (filter == ConductorsToUpdate) foreach(Conductor *conductor, conductorsToUpdate)        { if (conductor -> isSelected()) ++ count; }
+		if (filter == OtherConductors)    foreach(Conductor *conductor, otherConductors)           { if (conductor -> isSelected()) ++ count; }
 	} else {
-		if (filter & Elements)           count += elements.count();
-		if (filter & TextFields)         count += textFields.count();
-		if (filter & Images)			 count += images.count();
-		if (filter & ConductorsToMove)   count += conductorsToMove.count();
-		if (filter & ConductorsToUpdate) count += conductorsToUpdate.count();
-		if (filter & OtherConductors)    count += otherConductors.count();
+		if (filter == Elements)           count += elements.count();
+		if (filter == TextFields)         count += textFields.count();
+		if (filter == Images)			  count += images.count();
+		if (filter == ConductorsToMove)   count += conductorsToMove.count();
+		if (filter == ConductorsToUpdate) count += conductorsToUpdate.count();
+		if (filter == OtherConductors)    count += otherConductors.count();
 	}
 	return(count);
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/