]> granicus.if.org Git - clang/commitdiff
Patch by Nikita Zhuk:
authorTed Kremenek <kremenek@apple.com>
Tue, 28 Oct 2008 19:56:52 +0000 (19:56 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 28 Oct 2008 19:56:52 +0000 (19:56 +0000)
The attached patch adds a checkbox to the scan-build summary report, which toggles all other checkboxes' states.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58344 91177308-0d34-0410-b5e6-96231b3b80d8

utils/scan-build

index cd5a3073d46039ec4eed83810aab17df40cc26cd..0c89f0327adb8d0dbef4125bc5c4f516375d43eb 100755 (executable)
@@ -489,6 +489,18 @@ function SetDisplay(RowClass, DisplayVal)
   }
 }
 
+function CopyCheckedStateToCheckButtons(SummaryCheckButton) {
+  var Inputs = document.getElementsByTagName("input");
+  for ( var i = 0 ; i < Inputs.length; ++i ) {
+    if (Inputs[i].type == "checkbox") {
+      if(Inputs[i] != SummaryCheckButton) {
+        Inputs[i].checked = SummaryCheckButton.checked;
+        Inputs[i].onclick();
+         }
+    }
+  }
+}
+
 function ToggleDisplay(CheckButton, ClassName) {
   if (CheckButton.checked) {
     SetDisplay(ClassName, "");
@@ -536,9 +548,12 @@ ENDTEXT
       print OUT "\n<p>Results in this analysis run are based on analyzer build <b>$BuildName</b>.</p>\n"
     }
   
+  
+  my $TotalBugs = scalar(@Index);
 print OUT <<ENDTEXT;
 <table>
 <thead><tr><td>Bug Type</td><td>Quantity</td><td class="sorttable_nosort">Display?</td></tr></thead>
+<tr style="font-weight:bold"><td class="SUMM_DESC">All Bugs</td><td class="Q">$TotalBugs</td><td><center><input type="checkbox" onClick="CopyCheckedStateToCheckButtons(this);" checked/></center></td></tr>
 ENDTEXT
   
     my $last_category;
@@ -562,7 +577,7 @@ ENDTEXT
       $x =~ s/[ ,'":\/()]+/_/g;
       print OUT "<tr><td class=\"SUMM_DESC\">";
       print OUT $val->[2];
-      print OUT "</td><td>";
+      print OUT "</td><td class=\"Q\">";
       print OUT $val->[0];
       print OUT "</td><td><center><input type=\"checkbox\" onClick=\"ToggleDisplay(this,'bt_$x');\" checked/></center></td></tr>\n";
     }