Bug 423698 - Incorrectly used variables in nsAccessibleWrap::FireAccessibleEvent(), patch=aaronlev, r=me, a=beltzner
authorsurkov.alexander@gmail.com
Wed, 19 Mar 2008 18:12:57 -0700
changeset 13347 2d88d312cd634215eed63afd7c7f7d4f2c0625eb
parent 13346 b13f23028d25381f59dfac1a688581f50ccf2e92
child 13348 9ccf387500ff4cf51e1479efcbd1f00b41251dd8
push idunknown
push userunknown
push dateunknown
reviewersme, beltzner
bugs423698
milestone1.9b5pre
Bug 423698 - Incorrectly used variables in nsAccessibleWrap::FireAccessibleEvent(), patch=aaronlev, r=me, a=beltzner
accessible/src/msaa/nsAccessibleWrap.cpp
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -1667,21 +1667,16 @@ nsAccessibleWrap::FireAccessibleEvent(ns
   // Means we're not active.
   NS_ENSURE_TRUE(mWeakShell, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsIAccessible> accessible;
   aEvent->GetAccessible(getter_AddRefs(accessible));
   if (!accessible)
     return NS_OK;
 
-  PRUint32 role = ROLE_SYSTEM_TEXT; // Default value
-
-  nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(accessible));
-  NS_ENSURE_STATE(accessNode);
-
   if (eventType == nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED ||
       eventType == nsIAccessibleEvent::EVENT_FOCUS) {
     UpdateSystemCaret();
   }
  
   PRInt32 childID = GetChildIDFor(accessible); // get the id for the accessible
   if (!childID)
     return NS_OK; // Can't fire an event without a child ID
@@ -1692,17 +1687,17 @@ nsAccessibleWrap::FireAccessibleEvent(ns
       eventType == nsIAccessibleEvent::EVENT_DOM_DESTROY) {
     // Don't use frame from current accessible when we're hiding that
     // accessible.
     accessible->GetParent(getter_AddRefs(newAccessible));
   } else {
     newAccessible = accessible;
   }
 
-  HWND hWnd = GetHWNDFor(accessible);
+  HWND hWnd = GetHWNDFor(newAccessible);
   NS_ENSURE_TRUE(hWnd, NS_ERROR_FAILURE);
 
   // Gecko uses two windows for every scrollable area. One window contains
   // scrollbars and the child window contains only the client area.
   // Details of the 2 window system:
   // * Scrollbar window: caret drawing window & return value for WindowFromAccessibleObject()
   // * Client area window: text drawing window & MSAA event window