Bug 1735722 part 5: Rename ia2AccessibleHypertext::TextAcc to LocalTextAcc. r=morgan
authorJames Teh <jteh@mozilla.com>
Tue, 19 Oct 2021 03:57:19 +0000
changeset 596275 c4747685e885043bb7ebdc61dc8712c396ec0aef
parent 596274 417190cd31c6d1cc7dfa8f44b1f1a25e9efd2fc2
child 596276 5ce097bae42653d4b8e8746f6c40876620449270
push id38893
push usermlaza@mozilla.com
push dateTue, 19 Oct 2021 09:53:57 +0000
treeherdermozilla-central@4185629111d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmorgan
bugs1735722
milestone95.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 1735722 part 5: Rename ia2AccessibleHypertext::TextAcc to LocalTextAcc. r=morgan This makes way for a new unified TextAcc method in a subsequent patch. Strictly speaking, doing it like this isn't correct because methods will return CO_E_OBJNOTCONNECTED for a RemoteAccessible instead of E_NOTIMPL. I fixed this for IAccessibleText, but I realised fixing this for all interfaces is going to involve a lot of churn which we're going to end up removing anyway once we unify everything. Clients don't really care about the error code, so I think this situation is acceptable while this is still in early development. Differential Revision: https://phabricator.services.mozilla.com/D128554
accessible/windows/ia2/ia2AccessibleHypertext.cpp
accessible/windows/ia2/ia2AccessibleHypertext.h
--- a/accessible/windows/ia2/ia2AccessibleHypertext.cpp
+++ b/accessible/windows/ia2/ia2AccessibleHypertext.cpp
@@ -9,17 +9,17 @@
 
 #include "AccessibleHypertext_i.c"
 
 #include "HyperTextAccessibleWrap.h"
 #include "IUnknownImpl.h"
 
 using namespace mozilla::a11y;
 
-HyperTextAccessibleWrap* ia2AccessibleHypertext::TextAcc() {
+HyperTextAccessibleWrap* ia2AccessibleHypertext::LocalTextAcc() {
   AccessibleWrap* acc = LocalAcc();
   return static_cast<HyperTextAccessibleWrap*>(acc);
 }
 
 // IUnknown
 STDMETHODIMP
 ia2AccessibleHypertext::QueryInterface(REFIID aIID, void** aInstancePtr) {
   if (!aInstancePtr) return E_FAIL;
@@ -52,32 +52,32 @@ ia2AccessibleHypertext::QueryInterface(R
 // IAccessibleHypertext
 
 STDMETHODIMP
 ia2AccessibleHypertext::get_nHyperlinks(long* aHyperlinkCount) {
   if (!aHyperlinkCount) return E_INVALIDARG;
 
   *aHyperlinkCount = 0;
 
-  HyperTextAccessibleWrap* hyperText = TextAcc();
+  HyperTextAccessibleWrap* hyperText = LocalTextAcc();
   if (!hyperText) return CO_E_OBJNOTCONNECTED;
 
   *aHyperlinkCount = hyperText->LinkCount();
   return S_OK;
 }
 
 STDMETHODIMP
 ia2AccessibleHypertext::get_hyperlink(long aLinkIndex,
                                       IAccessibleHyperlink** aHyperlink) {
   if (!aHyperlink) return E_INVALIDARG;
 
   *aHyperlink = nullptr;
 
   LocalAccessible* hyperLink;
-  HyperTextAccessibleWrap* hyperText = TextAcc();
+  HyperTextAccessibleWrap* hyperText = LocalTextAcc();
   if (!hyperText) {
     return CO_E_OBJNOTCONNECTED;
   }
 
   hyperLink = hyperText->LinkAt(aLinkIndex);
 
   if (!hyperLink) return E_FAIL;
 
@@ -91,34 +91,34 @@ ia2AccessibleHypertext::get_hyperlink(lo
 
 STDMETHODIMP
 ia2AccessibleHypertext::get_hyperlinkIndex(long aCharIndex,
                                            long* aHyperlinkIndex) {
   if (!aHyperlinkIndex) return E_INVALIDARG;
 
   *aHyperlinkIndex = 0;
 
-  HyperTextAccessibleWrap* hyperAcc = TextAcc();
+  HyperTextAccessibleWrap* hyperAcc = LocalTextAcc();
   if (!hyperAcc) return CO_E_OBJNOTCONNECTED;
 
   *aHyperlinkIndex = hyperAcc->LinkIndexAtOffset(aCharIndex);
   return S_OK;
 }
 
 STDMETHODIMP
 ia2AccessibleHypertext::get_hyperlinks(IAccessibleHyperlink*** aHyperlinks,
                                        long* aNHyperlinks) {
   if (!aHyperlinks || !aNHyperlinks) {
     return E_INVALIDARG;
   }
 
   *aHyperlinks = nullptr;
   *aNHyperlinks = 0;
 
-  HyperTextAccessibleWrap* hyperText = TextAcc();
+  HyperTextAccessibleWrap* hyperText = LocalTextAcc();
   if (!hyperText) {
     return CO_E_OBJNOTCONNECTED;
   }
 
   uint32_t count = hyperText->LinkCount();
   *aNHyperlinks = count;
 
   if (count == 0) {
--- a/accessible/windows/ia2/ia2AccessibleHypertext.h
+++ b/accessible/windows/ia2/ia2AccessibleHypertext.h
@@ -54,15 +54,15 @@ class ia2AccessibleHypertext : public ia
   virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_hyperlinks(
       /* [out, size_is(,*nHyperlinks)] */ IAccessibleHyperlink*** hyperlinks,
       /* [out, retval] */ long* nHyperlinks);
 
  protected:
   using MsaaAccessible::MsaaAccessible;
 
  private:
-  HyperTextAccessibleWrap* TextAcc();
+  HyperTextAccessibleWrap* LocalTextAcc();
 };
 
 }  // namespace a11y
 }  // namespace mozilla
 
 #endif