From e32293718c6341d1b3cd0279b129cb56a0bc8189 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Sat, 29 Aug 1998 03:14:46 +0000 Subject: [PATCH] Stubbed out HandleDOMEvent; and initialized refcnt (doh!) --- layout/html/content/src/nsHTMLHR.cpp | 37 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/layout/html/content/src/nsHTMLHR.cpp b/layout/html/content/src/nsHTMLHR.cpp index 1f5ee61b0274..47cdc43a5a90 100644 --- a/layout/html/content/src/nsHTMLHR.cpp +++ b/layout/html/content/src/nsHTMLHR.cpp @@ -76,8 +76,23 @@ protected: nsHTMLGenericLeafContent mInner; }; +nsresult +NS_NewHTMLHR(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag) +{ + NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); + if (nsnull == aInstancePtrResult) { + return NS_ERROR_NULL_POINTER; + } + nsIHTMLContent* it = new nsHTMLHR(aTag); + if (nsnull == it) { + return NS_ERROR_OUT_OF_MEMORY; + } + return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); +} + nsHTMLHR::nsHTMLHR(nsIAtom* aTag) { + NS_INIT_REFCNT(); mInner.Init(this, aTag); } @@ -96,13 +111,12 @@ nsHTMLHR::QueryInterface(REFNSIID aIID, void** aInstancePtr) if (aIID.Equals(kIDOMHTMLHRElementIID)) { nsIDOMHTMLHRElement* tmp = this; *aInstancePtr = (void*) tmp; - mRefCnt++; + AddRef(); return NS_OK; } return NS_NOINTERFACE; } - nsresult nsHTMLHR::CloneNode(nsIDOMNode** aReturn) { @@ -247,16 +261,13 @@ nsHTMLHR::MapAttributesInto(nsIStyleContext* aContext, } } -nsresult -NS_NewHTMLHR(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag) +NS_IMETHODIMP +nsHTMLHR::HandleDOMEvent(nsIPresContext& aPresContext, + nsEvent* aEvent, + nsIDOMEvent** aDOMEvent, + PRUint32 aFlags, + nsEventStatus& aEventStatus) { - NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr"); - if (nsnull == aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsIHTMLContent* it = new nsHTMLHR(aTag); - if (nsnull == it) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult); + return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent, + aFlags, aEventStatus); }