Bug 1315601 part 12 - Remove useless retval out param from InsertRuleIntoGroup. r=heycam draft
authorXidorn Quan <me@upsuper.org>
Wed, 08 Mar 2017 17:11:42 +1100
changeset 497348 39815c7f1c4ab65b32fa5b41c4231c3e76661628
parent 497347 a1ecece1115d08e3c377d8eb1bcd8f7e34957dc2
child 497349 379cfa5390c2235b56d9539ec85d9bf821b8f209
push id48869
push userxquan@mozilla.com
push dateMon, 13 Mar 2017 06:50:23 +0000
reviewersheycam
bugs1315601
milestone55.0a1
Bug 1315601 part 12 - Remove useless retval out param from InsertRuleIntoGroup. r=heycam MozReview-Commit-ID: Iyj0zLj8nsL
layout/style/CSSStyleSheet.cpp
layout/style/CSSStyleSheet.h
layout/style/GroupRule.cpp
--- a/layout/style/CSSStyleSheet.cpp
+++ b/layout/style/CSSStyleSheet.cpp
@@ -929,18 +929,17 @@ CSSStyleSheet::DeleteRuleFromGroup(css::
   }
 
   return NS_OK;
 }
 
 nsresult
 CSSStyleSheet::InsertRuleIntoGroup(const nsAString & aRule,
                                    css::GroupRule* aGroup,
-                                   uint32_t aIndex,
-                                   uint32_t* _retval)
+                                   uint32_t aIndex)
 {
   NS_ASSERTION(mInner->mComplete, "No inserting into an incomplete sheet!");
   // check that the group actually belongs to this sheet!
   if (this != aGroup->GetStyleSheet()) {
     return NS_ERROR_INVALID_ARG;
   }
 
   // Hold strong ref to the CSSLoader in case the document update
@@ -988,17 +987,16 @@ CSSStyleSheet::InsertRuleIntoGroup(const
   result = aGroup->InsertStyleRuleAt(aIndex, rule);
   NS_ENSURE_SUCCESS(result, result);
   DidDirty();
 
   if (mDocument) {
     mDocument->StyleRuleAdded(this, rule);
   }
 
-  *_retval = aIndex;
   return NS_OK;
 }
 
 // nsICSSLoaderObserver implementation
 NS_IMETHODIMP
 CSSStyleSheet::StyleSheetLoaded(StyleSheet* aSheet,
                                 bool aWasAlternate,
                                 nsresult aStatus)
--- a/layout/style/CSSStyleSheet.h
+++ b/layout/style/CSSStyleSheet.h
@@ -112,17 +112,17 @@ public:
 
   // XXX do these belong here or are they generic?
   void AppendStyleRule(css::Rule* aRule);
 
   int32_t StyleRuleCount() const;
   css::Rule* GetStyleRuleAt(int32_t aIndex) const;
 
   nsresult DeleteRuleFromGroup(css::GroupRule* aGroup, uint32_t aIndex);
-  nsresult InsertRuleIntoGroup(const nsAString& aRule, css::GroupRule* aGroup, uint32_t aIndex, uint32_t* _retval);
+  nsresult InsertRuleIntoGroup(const nsAString& aRule, css::GroupRule* aGroup, uint32_t aIndex);
 
   void SetOwnerRule(css::ImportRule* aOwnerRule) { mOwnerRule = aOwnerRule; /* Not ref counted */ }
   css::ImportRule* GetOwnerRule() const { return mOwnerRule; }
   // Workaround overloaded-virtual warning in GCC.
   using StyleSheet::GetOwnerRule;
 
   nsXMLNameSpaceMap* GetNameSpaceMap() const {
     return Inner()->mNameSpaceMap;
--- a/layout/style/GroupRule.cpp
+++ b/layout/style/GroupRule.cpp
@@ -363,24 +363,23 @@ GroupRule::InsertRule(const nsAString& a
   uint32_t count = StyleRuleCount();
   if (aIndex > count) {
     aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return 0;
   }
 
   NS_ASSERTION(count <= INT32_MAX, "Too many style rules!");
 
-  uint32_t retval;
   nsresult rv =
-    sheet->AsGecko()->InsertRuleIntoGroup(aRule, this, aIndex, &retval);
+    sheet->AsGecko()->InsertRuleIntoGroup(aRule, this, aIndex);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
     return 0;
   }
-  return retval;
+  return aIndex;
 }
 
 nsresult
 GroupRule::DeleteRule(uint32_t aIndex)
 {
   ErrorResult rv;
   DeleteRule(aIndex, rv);
   return rv.StealNSResult();