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:
aaronleventhal%moonset.net
2007-06-08 14:16:27 +00:00
parent 27955d9663
commit 91feac62f7
6 changed files with 9 additions and 10 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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();

View File

@@ -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();

View File

@@ -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;