From 2a5c341197cacb2dfe681a37c0f4fb59564fd2ea Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Mon, 12 Feb 2001 21:19:23 +0000 Subject: [PATCH] Only get the type when we need it. r=hixie --- layout/forms/nsHTMLButtonControlFrame.cpp | 5 ++--- layout/html/forms/src/nsHTMLButtonControlFrame.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 2fd0e49dba4e..e392ad969017 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -330,9 +330,6 @@ nsHTMLButtonControlFrame::IsSubmit(nsIPresContext* aPresContext, PRInt32 type) void nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext) { - PRInt32 type; - GetType(&type); - if ((nsnull != mFormFrame) && !nsFormFrame::GetDisabled(this)) { nsEventStatus status = nsEventStatus_eIgnore; nsEvent event; @@ -343,6 +340,8 @@ nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext) nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); if (presShell) { + PRInt32 type; + GetType(&type); if (IsReset(type) == PR_TRUE) { event.message = NS_FORM_RESET; presShell->HandleEventWithTarget(&event, nsnull, formContent, NS_EVENT_FLAG_INIT, &status); diff --git a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 2fd0e49dba4e..e392ad969017 100644 --- a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -330,9 +330,6 @@ nsHTMLButtonControlFrame::IsSubmit(nsIPresContext* aPresContext, PRInt32 type) void nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext) { - PRInt32 type; - GetType(&type); - if ((nsnull != mFormFrame) && !nsFormFrame::GetDisabled(this)) { nsEventStatus status = nsEventStatus_eIgnore; nsEvent event; @@ -343,6 +340,8 @@ nsHTMLButtonControlFrame::MouseClicked(nsIPresContext* aPresContext) nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); if (presShell) { + PRInt32 type; + GetType(&type); if (IsReset(type) == PR_TRUE) { event.message = NS_FORM_RESET; presShell->HandleEventWithTarget(&event, nsnull, formContent, NS_EVENT_FLAG_INIT, &status);