bug 736252 - remove uses of do_QueryInterface in CAccessibleAction r=surkov

This commit is contained in:
Neil Rashbrook 2012-04-01 15:49:37 -04:00
Родитель c000a17966
Коммит fdab0ffc9e
1 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -42,7 +42,7 @@
#include "AccessibleAction_i.c" #include "AccessibleAction_i.c"
#include "nsAccessible.h" #include "nsAccessibleWrap.h"
// IUnknown // IUnknown
@ -71,8 +71,8 @@ __try {
*aActionCount = 0; *aActionCount = 0;
nsRefPtr<nsAccessible> acc(do_QueryObject(this)); nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (!acc || acc->IsDefunct()) if (acc->IsDefunct())
return E_FAIL; return E_FAIL;
*aActionCount = acc->ActionCount(); *aActionCount = acc->ActionCount();
@ -86,8 +86,8 @@ STDMETHODIMP
CAccessibleAction::doAction(long aActionIndex) CAccessibleAction::doAction(long aActionIndex)
{ {
__try { __try {
nsCOMPtr<nsIAccessible> acc(do_QueryObject(this)); nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (!acc) if (acc->IsDefunct())
return E_FAIL; return E_FAIL;
PRUint8 index = static_cast<PRUint8>(aActionIndex); PRUint8 index = static_cast<PRUint8>(aActionIndex);
@ -104,8 +104,8 @@ CAccessibleAction::get_description(long aActionIndex, BSTR *aDescription)
__try { __try {
*aDescription = NULL; *aDescription = NULL;
nsCOMPtr<nsIAccessible> acc(do_QueryObject(this)); nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (!acc) if (acc->IsDefunct())
return E_FAIL; return E_FAIL;
nsAutoString description; nsAutoString description;
@ -142,8 +142,8 @@ __try {
if (aActionIndex != 0 || aNumMaxBinding < 1) if (aActionIndex != 0 || aNumMaxBinding < 1)
return E_INVALIDARG; return E_INVALIDARG;
nsRefPtr<nsAccessible> acc(do_QueryObject(this)); nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (!acc || acc->IsDefunct()) if (acc->IsDefunct())
return E_FAIL; return E_FAIL;
// Expose keyboard shortcut if it's not exposed via MSAA keyboard shortcut. // Expose keyboard shortcut if it's not exposed via MSAA keyboard shortcut.
@ -181,8 +181,8 @@ CAccessibleAction::get_name(long aActionIndex, BSTR *aName)
__try { __try {
*aName = NULL; *aName = NULL;
nsCOMPtr<nsIAccessible> acc(do_QueryObject(this)); nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
if (!acc) if (acc->IsDefunct())
return E_FAIL; return E_FAIL;
nsAutoString name; nsAutoString name;