Bug 383608. Some IA2 interfaces must check smart XPCOM QI to see if a given object supports that interface. r=surkov
git-svn-id: svn://10.0.0.236/trunk@227696 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -56,10 +56,6 @@ CAccessibleAction::QueryInterface(REFIID iid, void** ppv)
|
||||
*ppv = NULL;
|
||||
|
||||
if (IID_IAccessibleAction == iid) {
|
||||
nsCOMPtr<nsIAccessible> acc(do_QueryInterface(this));
|
||||
if (!acc)
|
||||
return E_FAIL;
|
||||
|
||||
*ppv = NS_STATIC_CAST(IAccessibleAction*, this);
|
||||
(NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef();
|
||||
return S_OK;
|
||||
|
||||
@@ -67,10 +67,6 @@ CAccessibleComponent::QueryInterface(REFIID iid, void** ppv)
|
||||
*ppv = NULL;
|
||||
|
||||
if (IID_IAccessibleComponent == iid) {
|
||||
nsCOMPtr<nsIAccessible> acc(do_QueryInterface(this));
|
||||
if (!acc)
|
||||
return E_FAIL;
|
||||
|
||||
*ppv = NS_STATIC_CAST(IAccessibleComponent*, this);
|
||||
(NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef();
|
||||
return S_OK;
|
||||
|
||||
@@ -61,6 +61,9 @@ CAccessibleEditableText::QueryInterface(REFIID iid, void** ppv)
|
||||
*ppv = NULL;
|
||||
|
||||
if (IID_IAccessibleEditableText == iid) {
|
||||
nsCOMPtr<nsIAccessibleEditableText> editTextAcc(do_QueryInterface(this));
|
||||
if (!editTextAcc)
|
||||
return E_NOINTERFACE;
|
||||
*ppv = NS_STATIC_CAST(IAccessibleEditableText*, this);
|
||||
(NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef();
|
||||
return S_OK;
|
||||
|
||||
@@ -63,7 +63,7 @@ CAccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
|
||||
if (IID_IAccessibleHyperlink == iid) {
|
||||
nsCOMPtr<nsIAccessibleHyperLink> acc(do_QueryInterface(this));
|
||||
if (!acc)
|
||||
return E_FAIL;
|
||||
return E_NOINTERFACE;
|
||||
|
||||
*ppv = NS_STATIC_CAST(IAccessibleHyperlink*, this);
|
||||
(NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef();
|
||||
|
||||
@@ -57,7 +57,7 @@ CAccessibleHypertext::QueryInterface(REFIID iid, void** ppv)
|
||||
if (IID_IAccessibleHypertext == iid) {
|
||||
nsCOMPtr<nsIAccessibleHyperText> hyperAcc(do_QueryInterface(this));
|
||||
if (!hyperAcc)
|
||||
return E_FAIL;
|
||||
return E_NOINTERFACE;
|
||||
|
||||
*ppv = NS_STATIC_CAST(IAccessibleHypertext*, this);
|
||||
(NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef();
|
||||
|
||||
@@ -66,6 +66,10 @@ CAccessibleText::QueryInterface(REFIID iid, void** ppv)
|
||||
*ppv = NULL;
|
||||
|
||||
if (IID_IAccessibleText == iid) {
|
||||
nsCOMPtr<nsIAccessibleText> textAcc(do_QueryInterface(this));
|
||||
if (!textAcc) {
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
*ppv = NS_STATIC_CAST(IAccessibleText*, this);
|
||||
(NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef();
|
||||
return S_OK;
|
||||
|
||||
Reference in New Issue
Block a user