Bug 1315601 part 12 - Remove useless retval out param from InsertRuleIntoGroup. r=heycam
MozReview-Commit-ID: Iyj0zLj8nsL
--- 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();