Bug 741701 - CAccessibleHyperlink::get_anchor shouldn't use nsIWinAccessNode, r=tbsaunde, f=surkov
authorMark Capella <markcapella@twcny.rr.com>
Mon, 09 Apr 2012 19:38:39 +0900
changeset 94556 db8d17856c4eb5f352692f5236605b0b3591f008
parent 94555 4bcba0e0eecaebfa314d050ff947b1a5987560e8
child 94557 1721afdbf0c3796bc1870e1526f0f2eac204a1fa
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs741701
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 741701 - CAccessibleHyperlink::get_anchor shouldn't use nsIWinAccessNode, r=tbsaunde, f=surkov
accessible/src/msaa/CAccessibleHyperlink.cpp
--- a/accessible/src/msaa/CAccessibleHyperlink.cpp
+++ b/accessible/src/msaa/CAccessibleHyperlink.cpp
@@ -39,17 +39,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "CAccessibleHyperlink.h"
 
 #include "Accessible2.h"
 #include "AccessibleHyperlink.h"
 #include "AccessibleHyperlink_i.c"
 
-#include "nsAccessible.h"
+#include "nsAccessibleWrap.h"
 #include "nsIWinAccessNode.h"
 
 // IUnknown
 
 STDMETHODIMP
 CAccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
 {
   *ppv = NULL;
@@ -77,30 +77,27 @@ CAccessibleHyperlink::get_anchor(long aI
 
   nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
   if (thisObj->IsDefunct() || !thisObj->IsLink())
     return E_FAIL;
 
   if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
     return E_INVALIDARG;
 
-  nsAccessible* anchor = thisObj->AnchorAt(aIndex);
+  nsAccessibleWrap* anchor =
+    static_cast<nsAccessibleWrap*>(thisObj->AnchorAt(aIndex));
   if (!anchor)
     return S_FALSE;
 
-  nsCOMPtr<nsIWinAccessNode> winAccessNode(do_QueryObject(anchor));
-  if (!winAccessNode)
-    return E_FAIL;
+  void* instancePtr = NULL;
+  HRESULT result = anchor->QueryInterface(IID_IUnknown, &instancePtr);
+  if (FAILED(result))
+    return result;
 
-  void *instancePtr = NULL;
-  nsresult rv = winAccessNode->QueryNativeInterface(IID_IUnknown, &instancePtr);
-  if (NS_FAILED(rv))
-    return E_FAIL;
-
-  IUnknown *unknownPtr = static_cast<IUnknown*>(instancePtr);
+  IUnknown* unknownPtr = static_cast<IUnknown*>(instancePtr);
   aAnchor->ppunkVal = &unknownPtr;
   aAnchor->vt = VT_UNKNOWN;
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }