From b14d9fa790fb0ad42fdb28bae72baf528d3edfca Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Thu, 20 Apr 2006 03:38:43 +0000 Subject: [PATCH] Improve the way in which nsEvent and its subclasses are initialized. Commonly-used members can now be initialized via an inline constructor, and all other members are initialized to zero. eventStructType is set automatically. This also fixes some cases where an eventStructType was doubling as a message -- NS_TEXT_EVENT is now only used as an eventStructType, with a message of NS_TEXT_TEXT. NS_COMPOSITION_* events get an eventStructType of NS_COMPOSITION_EVENT, and ditto for NS_RECONVERSION_*. NS_DRAGDROP_EVENT is no longer an eventStructType since it is not a unique type of struct. There is also some miscellaneous cleanup to nsDOMEvent. Bug 220228, r=jst, sr=blizzard. --- content/base/src/nsXMLHttpRequest.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 374f7f0690ab..11d9c7cf3440 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -1082,9 +1082,7 @@ nsXMLHttpRequest::RequestCompleted() return NS_ERROR_FAILURE; } - nsEvent event; - event.eventStructType = NS_EVENT; - event.message = NS_PAGE_LOAD; + nsEvent event(NS_PAGE_LOAD); rv = manager->CreateEvent(nsnull, &event, NS_LITERAL_STRING("HTMLEvents"), getter_AddRefs(domevent));