From f7fb4bd1757cfaa835fd95912e4922a8483b5d17 Mon Sep 17 00:00:00 2001 From: troy Date: Sun, 14 Jun 1998 04:40:52 +0000 Subject: [PATCH] Changed a GetStyleContext/GetStyleData pair to use the nsIFrame::GetStyleData member function instead. This saves a pair of AddRef/Release calls --- layout/html/base/src/nsHTMLBase.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/layout/html/base/src/nsHTMLBase.cpp b/layout/html/base/src/nsHTMLBase.cpp index 38c23b752db..7570b0e34c5 100644 --- a/layout/html/base/src/nsHTMLBase.cpp +++ b/layout/html/base/src/nsHTMLBase.cpp @@ -47,10 +47,8 @@ nsHTMLBase::CreateViewForFrame(nsIPresContext* aPresContext, aStyleContext->GetStyleData(eStyleStruct_Color); // Get parent's nsStyleColor - nsIStyleContext* parentSC; - parent->GetStyleContext(aPresContext, parentSC); - const nsStyleColor* parentColor = (const nsStyleColor*) - parentSC->GetStyleData(eStyleStruct_Color); + const nsStyleColor* parentColor; + parent->GetStyleData(eStyleStruct_Color, (const nsStyleStruct*&)parentColor); // If the opacities are different then I need a view if (myColor->mOpacity != parentColor->mOpacity) { @@ -59,7 +57,6 @@ nsHTMLBase::CreateViewForFrame(nsIPresContext* aPresContext, aFrame, myColor->mOpacity, parentColor->mOpacity)); aForce = PR_TRUE; } - NS_RELEASE(parentSC); } }