Bug 600620 - followup: fix typo in aboutSupport.js - r=jmuizelaar, a=blocking2.0-beta7 GECKO20b7pre_20101006_RELBRANCH SEAMONKEY_2_1b1_BUILD2 SEAMONKEY_2_1b1_RELEASE
authorBenoit Jacob <bjacob@mozilla.com>
Thu, 07 Oct 2010 22:31:43 -0700
branchGECKO20b7pre_20101006_RELBRANCH
changeset 55166 d0b8dbaced2c402ac3d1801db90fae60cc23cd62
parent 55156 380b0e2e61ad8ba3968b0ec249c81cf360a6e0b9
child 55229 f6b1a30f4f95643222b6fe7fb24b7ee54866a9a8
push idunknown
push userunknown
push dateunknown
reviewersjmuizelaar, blocking2
bugs600620
milestone2.0b7pre
Bug 600620 - followup: fix typo in aboutSupport.js - r=jmuizelaar, a=blocking2.0-beta7
toolkit/content/aboutSupport.js
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -148,19 +148,23 @@ function populateGraphicsSection() {
     let elem = createElement("th", name);
     elem.className = "column";
     return elem;
   }
 
   let bundle = Services.strings.createBundle("chrome://global/locale/aboutSupport.properties");
   let graphics_tbody = document.getElementById("graphics-tbody");
 
+  var gfxInfo = null;
   try {
     // nsIGfxInfo is currently only implemented on Windows
-    let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
+    gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
+  } catch(e) {}
+
+  if (gfxInfo) {
     let trGraphics = [];
     trGraphics.push(createParentElement("tr", [
       createHeader(bundle.GetStringFromName("adapterDescription")),
       createElement("td", gfxInfo.adapterDescription),
     ]));
     trGraphics.push(createParentElement("tr", [
       createHeader(bundle.GetStringFromName("adapterVendorID")),
       // pad with zeros. (printf would be nicer)
@@ -186,44 +190,53 @@ function populateGraphicsSection() {
     trGraphics.push(createParentElement("tr", [
       createHeader(bundle.GetStringFromName("driverDate")),
       createElement("td", gfxInfo.adapterDriverDate),
     ]));
 
     var d2dEnabled = gfxInfo.D2DEnabled;
     var d2dMessage = d2dEnabled;
     if (!d2dEnabled) {
-      var d2dStatus = gfxInfo.getFeatureStatus(gfxgfxInfoInfo.FEATURE_DIRECT2D);
+      var d2dStatus = -1; // different from any status value defined in the IDL
+      try {
+        d2dStatus = gfxInfo.getFeatureStatus(gfxInfo.FEATURE_DIRECT2D);
+      } catch(e) {
+        window.dump(e + '\n');
+      }  
       if (d2dStatus == gfxInfo.FEATURE_BLOCKED_DEVICE ||
           d2dStatus == gfxInfo.FEATURE_DISCOURAGED)
       {
         d2dMessage = bundle.GetStringFromName("blockedGraphicsCard");
       }
       else if (d2dStatus == gfxInfo.FEATURE_BLOCKED_DRIVER_VERSION)
       {
-        var d2dSuggestedDriverVersion = gfxInfo.getFeatureSuggestedDriverVersion(gfxInfo.FEATURE_DIRECT2D);
+        var d2dSuggestedDriverVersion = null;
+        try {
+          gfxInfo.getFeatureSuggestedDriverVersion(gfxInfo.FEATURE_DIRECT2D);
+        } catch(e) {
+          window.dump(e + '\n');
+        }
         if (d2dSuggestedDriverVersion) {
-          d2dMessage += bundle.GetStringFromName("tryNewerDriverVersion").replace("%1", d2dSuggestedDriverVersion);
+          d2dMessage = bundle.GetStringFromName("tryNewerDriverVersion").replace("%1", d2dSuggestedDriverVersion);
         }
       }
     }
     trGraphics.push(createParentElement("tr", [
       createHeader(bundle.GetStringFromName("direct2DEnabled")),
       createElement("td", d2dMessage),
     ]));
 
     trGraphics.push(createParentElement("tr", [
       createHeader(bundle.GetStringFromName("directWriteEnabled")),
       createElement("td", gfxInfo.DWriteEnabled),
     ]));
 
     appendChildren(graphics_tbody, trGraphics);
 
-  } catch (e) {
-  }
+  } // end if (gfxInfo)
 
   let windows = Services.ww.getWindowEnumerator();
   let acceleratedWindows = 0;
   let totalWindows = 0;
   let mgrType;
   while (windows.hasMoreElements()) {
     totalWindows++;