Bug 483589 - PRBool problem in nsHTMLEditor::EnableExistingStyleSheet; r+sr=peterv
authorGraeme McCutcheon <graememcc_firefox@graeme-online.co.uk>
Wed, 18 Mar 2009 17:02:19 +0100
changeset 26307 3499bad5d5ce9ad0b63b86f022aae12592cf3438
parent 26306 d6513dcc48d91bf4eb87a11a52156ac446aa4c82
child 26308 ab02d55c587c1d8fcd3a87604d9efe0a60f98238
push id5999
push usersgautherie.bz@free.fr
push dateWed, 18 Mar 2009 16:09:15 +0000
treeherdermozilla-central@cd149fbe6f4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs483589
milestone1.9.2a1pre
Bug 483589 - PRBool problem in nsHTMLEditor::EnableExistingStyleSheet; r+sr=peterv
editor/libeditor/html/nsHTMLEditor.cpp
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -3689,25 +3689,27 @@ nsHTMLEditor::EnableStyleSheet(const nsA
   return domSheet->SetDisabled(!aEnable);
 }
 
 PRBool
 nsHTMLEditor::EnableExistingStyleSheet(const nsAString &aURL)
 {
   nsCOMPtr<nsICSSStyleSheet> sheet;
   nsresult rv = GetStyleSheetForURL(aURL, getter_AddRefs(sheet));
-  NS_ENSURE_SUCCESS(rv, rv);
+  if (NS_FAILED(rv))
+    return PR_FALSE;
 
   // Enable sheet if already loaded.
   if (sheet)
   {
     // Ensure the style sheet is owned by our document.
     nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocWeak);
     rv = sheet->SetOwningDocument(doc);
-    NS_ENSURE_SUCCESS(rv, rv);
+    if (NS_FAILED(rv))
+      return PR_FALSE;
 
     nsCOMPtr<nsIDOMStyleSheet> domSheet(do_QueryInterface(sheet));
     NS_ASSERTION(domSheet, "Sheet not implementing nsIDOMStyleSheet!");
     
     domSheet->SetDisabled(PR_FALSE);
     return PR_TRUE;
   }
   return PR_FALSE;