Bug 767264 - remove uses of do_QueryObject() in CAccessibleHyperlink, r=tbsaunde
authorMark Capella <markcapella@twcny.rr.com>
Tue, 26 Jun 2012 04:18:48 -0400
changeset 98008 49819cb0465490e9e54715d95f831f6d5151b001
parent 98007 a757d8b9cda176c0beb40d29acd14de557880ea8
child 98009 0c149cc0dd0cd1be91ef5f2581e1cf5b2902ddef
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerstbsaunde
bugs767264
milestone16.0a1
Bug 767264 - remove uses of do_QueryObject() in CAccessibleHyperlink, r=tbsaunde
accessible/src/msaa/AccessibleWrap.cpp
accessible/src/msaa/AccessibleWrap.h
accessible/src/msaa/CAccessibleHyperlink.cpp
accessible/src/msaa/CAccessibleHyperlink.h
accessible/src/msaa/Makefile.in
accessible/src/msaa/ia2AccessibleHyperlink.cpp
accessible/src/msaa/ia2AccessibleHyperlink.h
--- a/accessible/src/msaa/AccessibleWrap.cpp
+++ b/accessible/src/msaa/AccessibleWrap.cpp
@@ -98,17 +98,17 @@ AccessibleWrap::QueryInterface(REFIID ii
 
   if (NULL == *ppv) {
     HRESULT hr = ia2AccessibleComponent::QueryInterface(iid, ppv);
     if (SUCCEEDED(hr))
       return hr;
   }
 
   if (NULL == *ppv) {
-    HRESULT hr = CAccessibleHyperlink::QueryInterface(iid, ppv);
+    HRESULT hr = ia2AccessibleHyperlink::QueryInterface(iid, ppv);
     if (SUCCEEDED(hr))
       return hr;
   }
 
   if (NULL == *ppv) {
     HRESULT hr = CAccessibleValue::QueryInterface(iid, ppv);
     if (SUCCEEDED(hr))
       return hr;
--- a/accessible/src/msaa/AccessibleWrap.h
+++ b/accessible/src/msaa/AccessibleWrap.h
@@ -9,17 +9,17 @@
 
 #ifndef _AccessibleWrap_H_
 #define _AccessibleWrap_H_
 
 #include "nsCOMPtr.h"
 #include "Accessible.h"
 #include "Accessible2.h"
 #include "ia2AccessibleComponent.h"
-#include "CAccessibleHyperlink.h"
+#include "ia2AccessibleHyperlink.h"
 #include "CAccessibleValue.h"
 
 #define DECL_IUNKNOWN_INHERITED                                               \
 public:                                                                       \
 STDMETHODIMP QueryInterface(REFIID, void**);                                  \
 
 #define IMPL_IUNKNOWN_QUERY_HEAD(Class)                                       \
 STDMETHODIMP                                                                  \
@@ -60,17 +60,17 @@ Class::QueryInterface(REFIID iid, void**
   IMPL_IUNKNOWN_QUERY_ENTRY(I1);                                              \
   IMPL_IUNKNOWN_QUERY_ENTRY(I2);                                              \
   IMPL_IUNKNOWN_QUERY_ENTRY(Super)                                            \
   IMPL_IUNKNOWN_QUERY_TAIL                                                    \
 
 
 class AccessibleWrap : public Accessible,
                        public ia2AccessibleComponent,
-                       public CAccessibleHyperlink,
+                       public ia2AccessibleHyperlink,
                        public CAccessibleValue,
                        public IAccessible2
 {
 public: // construction, destruction
   AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
     Accessible(aContent, aDoc) { }
   virtual ~AccessibleWrap() { }
 
--- a/accessible/src/msaa/Makefile.in
+++ b/accessible/src/msaa/Makefile.in
@@ -21,26 +21,26 @@ CPPSRCS = \
   ARIAGridAccessibleWrap.cpp \
   DocAccessibleWrap.cpp \
   HTMLTableAccessibleWrap.cpp \
   HyperTextAccessibleWrap.cpp \
   ImageAccessibleWrap.cpp \
   nsAccessNodeWrap.cpp \
   nsHTMLWin32ObjectAccessible.cpp \
   nsWinUtils.cpp \
-  CAccessibleHyperlink.cpp \
   CAccessibleTable.cpp \
   CAccessibleTableCell.cpp \
   CAccessibleValue.cpp \
   Compatibility.cpp \
   EnumVariant.cpp \
   ia2AccessibleAction.cpp \
   ia2AccessibleComponent.cpp \
   ia2AccessibleEditableText.cpp \
   ia2AccessibleImage.cpp \
+  ia2AccessibleHyperlink.cpp \
   ia2AccessibleHypertext.cpp \
   ia2AccessibleRelation.cpp \
   ia2AccessibleText.cpp \
   RootAccessibleWrap.cpp \
   TextLeafAccessibleWrap.cpp \
   $(NULL)
 
 ifdef MOZ_XUL
rename from accessible/src/msaa/CAccessibleHyperlink.cpp
rename to accessible/src/msaa/ia2AccessibleHyperlink.cpp
--- a/accessible/src/msaa/CAccessibleHyperlink.cpp
+++ b/accessible/src/msaa/ia2AccessibleHyperlink.cpp
@@ -1,53 +1,50 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=2:
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "CAccessibleHyperlink.h"
-
 #include "Accessible2.h"
 #include "AccessibleHyperlink.h"
 #include "AccessibleHyperlink_i.c"
 
 #include "AccessibleWrap.h"
 #include "nsIWinAccessNode.h"
 
 // IUnknown
 
 STDMETHODIMP
-CAccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
+ia2AccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
 {
   *ppv = NULL;
 
   if (IID_IAccessibleHyperlink == iid) {
-    nsRefPtr<Accessible> thisObj = do_QueryObject(this);
-    if (!thisObj->IsLink())
+    if (!static_cast<AccessibleWrap*>(this)->IsLink())
       return E_NOINTERFACE;
 
     *ppv = static_cast<IAccessibleHyperlink*>(this);
     (reinterpret_cast<IUnknown*>(*ppv))->AddRef();
     return S_OK;
   }
 
   return ia2AccessibleAction::QueryInterface(iid, ppv);
 }
 
 // IAccessibleHyperlink
 
 STDMETHODIMP
-CAccessibleHyperlink::get_anchor(long aIndex, VARIANT *aAnchor)
+ia2AccessibleHyperlink::get_anchor(long aIndex, VARIANT* aAnchor)
 {
 __try {
   VariantInit(aAnchor);
 
-  nsRefPtr<Accessible> thisObj = do_QueryObject(this);
+  Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
     return E_INVALIDARG;
 
   if (!thisObj->IsLink())
     return S_FALSE;
@@ -67,22 +64,22 @@ CAccessibleHyperlink::get_anchor(long aI
   aAnchor->vt = VT_UNKNOWN;
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
-CAccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT *aAnchorTarget)
+ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget)
 {
 __try {
   VariantInit(aAnchorTarget);
 
-  nsRefPtr<Accessible> thisObj = do_QueryObject(this);
+  Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
     return E_INVALIDARG;
 
   if (!thisObj->IsLink())
     return S_FALSE;
@@ -110,62 +107,62 @@ CAccessibleHyperlink::get_anchorTarget(l
                                                stringURI.Length());
   return aAnchorTarget->bstrVal ? S_OK : E_OUTOFMEMORY;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
-CAccessibleHyperlink::get_startIndex(long *aIndex)
+ia2AccessibleHyperlink::get_startIndex(long* aIndex)
 {
 __try {
   *aIndex = 0;
 
-  nsRefPtr<Accessible> thisObj = do_QueryObject(this);
+  Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!thisObj->IsLink())
     return S_FALSE;
 
   *aIndex = thisObj->StartOffset();
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
-CAccessibleHyperlink::get_endIndex(long *aIndex)
+ia2AccessibleHyperlink::get_endIndex(long* aIndex)
 {
 __try {
   *aIndex = 0;
 
-  nsRefPtr<Accessible> thisObj = do_QueryObject(this);
+  Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!thisObj->IsLink())
     return S_FALSE;
 
   *aIndex = thisObj->EndOffset();
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
-CAccessibleHyperlink::get_valid(boolean *aValid)
+ia2AccessibleHyperlink::get_valid(boolean* aValid)
 {
 __try {
   *aValid = false;
 
-  nsRefPtr<Accessible> thisObj = do_QueryObject(this);
+  Accessible* thisObj = static_cast<AccessibleWrap*>(this);
   if (thisObj->IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   if (!thisObj->IsLink())
     return S_FALSE;
 
   *aValid = thisObj->IsLinkValid();
   return S_OK;
rename from accessible/src/msaa/CAccessibleHyperlink.h
rename to accessible/src/msaa/ia2AccessibleHyperlink.h
--- a/accessible/src/msaa/CAccessibleHyperlink.h
+++ b/accessible/src/msaa/ia2AccessibleHyperlink.h
@@ -8,18 +8,18 @@
 #ifndef _ACCESSIBLE_HYPERLINK_H
 #define _ACCESSIBLE_HYPERLINK_H
 
 #include "nsISupports.h"
 
 #include "ia2AccessibleAction.h"
 #include "AccessibleHyperlink.h"
 
-class CAccessibleHyperlink: public ia2AccessibleAction,
-                            public IAccessibleHyperlink
+class ia2AccessibleHyperlink : public ia2AccessibleAction,
+                               public IAccessibleHyperlink
 {
 public:
 
   // IUnknown
   STDMETHODIMP QueryInterface(REFIID, void**);
 
   // IAccessibleAction
   FORWARD_IACCESSIBLEACTION(ia2AccessibleAction)