Bug 778104 - NS_IMPL_STRING_ATTR incorrectly uses bool as nsresult; r=bz
authorAryeh Gregor <ayg@aryeh.name>
Mon, 30 Jul 2012 16:48:02 +0300
changeset 100888 ac1975f6837b68186ff256fbe78b6f1c57a2536e
parent 100887 bc901f8f47324875886d6a1027dfa0c67340ab80
child 100889 baffbb5841f39493559b2d7ee9d389c983627d0f
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbz
bugs778104
milestone17.0a1
Bug 778104 - NS_IMPL_STRING_ATTR incorrectly uses bool as nsresult; r=bz
content/base/src/nsGenericElement.h
--- a/content/base/src/nsGenericElement.h
+++ b/content/base/src/nsGenericElement.h
@@ -1046,18 +1046,18 @@ nsresult                                
  * SetAttr methods.  We use the 5-argument form of SetAttr, because
  * some consumers only implement that one, hiding superclass
  * 4-argument forms.
  */
 #define NS_IMPL_STRING_ATTR(_class, _method, _atom)                     \
   NS_IMETHODIMP                                                         \
   _class::Get##_method(nsAString& aValue)                               \
   {                                                                     \
-    /* XXX Invalid cast of bool to nsresult (bug 778104) */             \
-    return (nsresult)GetAttr(kNameSpaceID_None, nsGkAtoms::_atom, aValue); \
+    GetAttr(kNameSpaceID_None, nsGkAtoms::_atom, aValue);               \
+    return NS_OK;                                                       \
   }                                                                     \
   NS_IMETHODIMP                                                         \
   _class::Set##_method(const nsAString& aValue)                         \
   {                                                                     \
     return SetAttr(kNameSpaceID_None, nsGkAtoms::_atom, nullptr, aValue, true); \
   }
 
 /**