From ef82aa217be9b6dfa66617d6394f700b8b35a755 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Sun, 31 Mar 2013 18:08:29 -0400 Subject: [PATCH] bug 856779 - make nsStyleSet::Init() return void r=dholbert --- layout/base/nsPresShell.cpp | 3 +-- layout/style/nsStyleSet.cpp | 4 +--- layout/style/nsStyleSet.h | 5 +---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index a6ef89990ac1..b7de7fbb6978 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -812,8 +812,7 @@ PresShell::Init(nsIDocument* aDocument, aPresContext->SetShell(this); // Now we can initialize the style set. - result = aStyleSet->Init(aPresContext); - NS_ENSURE_SUCCESS(result, result); + aStyleSet->Init(aPresContext); // From this point on, any time we return an error we need to make // sure to null out mStyleSet first, since an error return from this diff --git a/layout/style/nsStyleSet.cpp b/layout/style/nsStyleSet.cpp index 36f328d80f73..bc72812042da 100644 --- a/layout/style/nsStyleSet.cpp +++ b/layout/style/nsStyleSet.cpp @@ -138,7 +138,7 @@ nsStyleSet::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const return n; } -nsresult +void nsStyleSet::Init(nsPresContext *aPresContext) { mFirstLineRule = new nsEmptyStyleRule; @@ -149,8 +149,6 @@ nsStyleSet::Init(nsPresContext *aPresContext) GatherRuleProcessors(eAnimationSheet); GatherRuleProcessors(eTransitionSheet); - - return NS_OK; } nsresult diff --git a/layout/style/nsStyleSet.h b/layout/style/nsStyleSet.h index f880ddbeb5bb..b3250b902964 100644 --- a/layout/style/nsStyleSet.h +++ b/layout/style/nsStyleSet.h @@ -62,10 +62,7 @@ class nsStyleSet size_t SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf) const; - // Initialize the object. You must check the return code and not use - // the nsStyleSet if Init() fails. - - nsresult Init(nsPresContext *aPresContext); + void Init(nsPresContext *aPresContext); nsRuleNode* GetRuleTree() { return mRuleTree; }