From e3110b2bb3c640f5627eaccd7c9a8caed0f85f44 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sun, 25 Aug 2013 11:55:23 +0000 Subject: [PATCH] replace & by ==, to better handle content git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2459 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/diagramcontent.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sources/diagramcontent.cpp b/sources/diagramcontent.cpp index 333a1ee4c..c3e5cbfe6 100644 --- a/sources/diagramcontent.cpp +++ b/sources/diagramcontent.cpp @@ -100,20 +100,20 @@ QList DiagramContent::items(int filter) const { */ 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); }