Bug 1323055: Remove A11Y_TRYBLOCK_* from Windows a11y code; r=tbsaunde

MozReview-Commit-ID: L3BBWaz004h

--HG--
extra : rebase_source : 01d471a322285fb5984cd220c39d8c768af0456d
This commit is contained in:
Aaron Klotz 2016-12-20 13:41:24 -07:00
parent e618b8d55a
commit 9d379dc100
22 changed files with 0 additions and 777 deletions

View File

@ -63,8 +63,6 @@ ia2Accessible::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ia2Accessible::get_nRelations(long* aNRelations)
{
A11Y_TRYBLOCK_BEGIN
if (!aNRelations)
return E_INVALIDARG;
*aNRelations = 0;
@ -84,16 +82,12 @@ ia2Accessible::get_nRelations(long* aNRelations)
(*aNRelations)++;
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_relation(long aRelationIndex,
IAccessibleRelation** aRelation)
{
A11Y_TRYBLOCK_BEGIN
if (!aRelation || aRelationIndex < 0)
return E_INVALIDARG;
*aRelation = nullptr;
@ -124,8 +118,6 @@ ia2Accessible::get_relation(long aRelationIndex,
}
return E_INVALIDARG;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -133,8 +125,6 @@ ia2Accessible::get_relations(long aMaxRelations,
IAccessibleRelation** aRelation,
long *aNRelations)
{
A11Y_TRYBLOCK_BEGIN
if (!aRelation || !aNRelations || aMaxRelations <= 0)
return E_INVALIDARG;
*aNRelations = 0;
@ -160,15 +150,11 @@ ia2Accessible::get_relations(long aMaxRelations,
}
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::role(long* aRole)
{
A11Y_TRYBLOCK_BEGIN
if (!aRole)
return E_INVALIDARG;
*aRole = 0;
@ -204,15 +190,11 @@ ia2Accessible::role(long* aRole)
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::scrollTo(enum IA2ScrollType aScrollType)
{
A11Y_TRYBLOCK_BEGIN
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
@ -222,16 +204,12 @@ ia2Accessible::scrollTo(enum IA2ScrollType aScrollType)
aScrollType);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType,
long aX, long aY)
{
A11Y_TRYBLOCK_BEGIN
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
@ -244,8 +222,6 @@ ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType,
acc->ScrollToPoint(geckoCoordType, aX, aY);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -253,8 +229,6 @@ ia2Accessible::get_groupPosition(long* aGroupLevel,
long* aSimilarItemsInGroup,
long* aPositionInGroup)
{
A11Y_TRYBLOCK_BEGIN
if (!aGroupLevel || !aSimilarItemsInGroup || !aPositionInGroup)
return E_INVALIDARG;
@ -279,15 +253,11 @@ ia2Accessible::get_groupPosition(long* aGroupLevel,
*aPositionInGroup = groupPos.posInSet;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_states(AccessibleStates* aStates)
{
A11Y_TRYBLOCK_BEGIN
if (!aStates)
return E_INVALIDARG;
*aStates = 0;
@ -347,50 +317,36 @@ ia2Accessible::get_states(AccessibleStates* aStates)
*aStates |= IA2_STATE_PINNED;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_extendedRole(BSTR* aExtendedRole)
{
A11Y_TRYBLOCK_BEGIN
if (!aExtendedRole)
return E_INVALIDARG;
*aExtendedRole = nullptr;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_localizedExtendedRole(BSTR* aLocalizedExtendedRole)
{
A11Y_TRYBLOCK_BEGIN
if (!aLocalizedExtendedRole)
return E_INVALIDARG;
*aLocalizedExtendedRole = nullptr;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_nExtendedStates(long* aNExtendedStates)
{
A11Y_TRYBLOCK_BEGIN
if (!aNExtendedStates)
return E_INVALIDARG;
*aNExtendedStates = 0;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -398,16 +354,12 @@ ia2Accessible::get_extendedStates(long aMaxExtendedStates,
BSTR** aExtendedStates,
long* aNExtendedStates)
{
A11Y_TRYBLOCK_BEGIN
if (!aExtendedStates || !aNExtendedStates)
return E_INVALIDARG;
*aExtendedStates = nullptr;
*aNExtendedStates = 0;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -415,38 +367,28 @@ ia2Accessible::get_localizedExtendedStates(long aMaxLocalizedExtendedStates,
BSTR** aLocalizedExtendedStates,
long* aNLocalizedExtendedStates)
{
A11Y_TRYBLOCK_BEGIN
if (!aLocalizedExtendedStates || !aNLocalizedExtendedStates)
return E_INVALIDARG;
*aLocalizedExtendedStates = nullptr;
*aNLocalizedExtendedStates = 0;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_uniqueID(long* aUniqueID)
{
A11Y_TRYBLOCK_BEGIN
if (!aUniqueID)
return E_INVALIDARG;
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
*aUniqueID = AccessibleWrap::GetChildIDFor(acc);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_windowHandle(HWND* aWindowHandle)
{
A11Y_TRYBLOCK_BEGIN
if (!aWindowHandle)
return E_INVALIDARG;
*aWindowHandle = 0;
@ -457,15 +399,11 @@ ia2Accessible::get_windowHandle(HWND* aWindowHandle)
*aWindowHandle = AccessibleWrap::GetHWNDFor(acc);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_indexInParent(long* aIndexInParent)
{
A11Y_TRYBLOCK_BEGIN
if (!aIndexInParent)
return E_INVALIDARG;
*aIndexInParent = -1;
@ -481,15 +419,11 @@ ia2Accessible::get_indexInParent(long* aIndexInParent)
return S_FALSE;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_locale(IA2Locale* aLocale)
{
A11Y_TRYBLOCK_BEGIN
if (!aLocale)
return E_INVALIDARG;
@ -532,15 +466,11 @@ ia2Accessible::get_locale(IA2Locale* aLocale)
// country abbreviations or if there are more than one subcode.
aLocale->variant = ::SysAllocString(lang.get());
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_attributes(BSTR* aAttributes)
{
A11Y_TRYBLOCK_BEGIN
if (!aAttributes)
return E_INVALIDARG;
*aAttributes = nullptr;
@ -558,8 +488,6 @@ ia2Accessible::get_attributes(BSTR* aAttributes)
MOZ_ASSERT(!acc->IsProxy());
return E_UNEXPECTED;
A11Y_TRYBLOCK_END
}
////////////////////////////////////////////////////////////////////////////////
@ -568,22 +496,16 @@ ia2Accessible::get_attributes(BSTR* aAttributes)
STDMETHODIMP
ia2Accessible::get_attribute(BSTR name, VARIANT* aAttribute)
{
A11Y_TRYBLOCK_BEGIN
if (!aAttribute)
return E_INVALIDARG;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible,
long* aCaretOffset)
{
A11Y_TRYBLOCK_BEGIN
if (!aAccessible || !aCaretOffset)
return E_INVALIDARG;
@ -611,8 +533,6 @@ ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible,
(*aAccessible)->AddRef();
*aCaretOffset = caretOffset;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -621,8 +541,6 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType,
IUnknown*** aTargets,
long* aNTargets)
{
A11Y_TRYBLOCK_BEGIN
if (!aTargets || !aNTargets || aMaxTargets < 0)
return E_INVALIDARG;
*aNTargets = 0;
@ -663,16 +581,12 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType,
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2Accessible::get_selectionRanges(IA2Range** aRanges,
long *aNRanges)
{
A11Y_TRYBLOCK_BEGIN
if (!aRanges || !aNRanges)
return E_INVALIDARG;
@ -714,8 +628,6 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges,
}
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -39,8 +39,6 @@ ia2AccessibleAction::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ia2AccessibleAction::nActions(long* aActionCount)
{
A11Y_TRYBLOCK_BEGIN
if (!aActionCount)
return E_INVALIDARG;
@ -52,30 +50,22 @@ ia2AccessibleAction::nActions(long* aActionCount)
*aActionCount = acc->ActionCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleAction::doAction(long aActionIndex)
{
A11Y_TRYBLOCK_BEGIN
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
uint8_t index = static_cast<uint8_t>(aActionIndex);
return acc->DoAction(index) ? S_OK : E_INVALIDARG;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleAction::get_description(long aActionIndex, BSTR *aDescription)
{
A11Y_TRYBLOCK_BEGIN
if (!aDescription)
return E_INVALIDARG;
*aDescription = nullptr;
@ -93,8 +83,6 @@ ia2AccessibleAction::get_description(long aActionIndex, BSTR *aDescription)
*aDescription = ::SysAllocStringLen(description.get(),
description.Length());
return *aDescription ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -102,8 +90,6 @@ ia2AccessibleAction::get_keyBinding(long aActionIndex, long aNumMaxBinding,
BSTR **aKeyBinding,
long *aNumBinding)
{
A11Y_TRYBLOCK_BEGIN
if (!aKeyBinding)
return E_INVALIDARG;
*aKeyBinding = nullptr;
@ -143,15 +129,11 @@ ia2AccessibleAction::get_keyBinding(long aActionIndex, long aNumMaxBinding,
*aNumBinding = 1;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleAction::get_name(long aActionIndex, BSTR *aName)
{
A11Y_TRYBLOCK_BEGIN
if (!aName)
return E_INVALIDARG;
@ -169,20 +151,14 @@ ia2AccessibleAction::get_name(long aActionIndex, BSTR *aName)
*aName = ::SysAllocStringLen(name.get(), name.Length());
return *aName ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleAction::get_localizedName(long aActionIndex, BSTR *aLocalizedName)
{
A11Y_TRYBLOCK_BEGIN
if (!aLocalizedName)
return E_INVALIDARG;
*aLocalizedName = nullptr;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}

View File

@ -41,8 +41,6 @@ ia2AccessibleComponent::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ia2AccessibleComponent::get_locationInParent(long* aX, long* aY)
{
A11Y_TRYBLOCK_BEGIN
if (!aX || !aY)
return E_INVALIDARG;
@ -75,15 +73,11 @@ ia2AccessibleComponent::get_locationInParent(long* aX, long* aY)
*aX = rect.x - parentRect.x;
*aY = rect.y - parentRect.y;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleComponent::get_foreground(IA2Color* aForeground)
{
A11Y_TRYBLOCK_BEGIN
if (!aForeground)
return E_INVALIDARG;
@ -98,15 +92,11 @@ ia2AccessibleComponent::get_foreground(IA2Color* aForeground)
*aForeground = frame->StyleColor()->mColor;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleComponent::get_background(IA2Color* aBackground)
{
A11Y_TRYBLOCK_BEGIN
if (!aBackground)
return E_INVALIDARG;
@ -122,7 +112,5 @@ ia2AccessibleComponent::get_background(IA2Color* aBackground)
}
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -22,8 +22,6 @@ using namespace mozilla::a11y;
STDMETHODIMP
ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -35,15 +33,11 @@ ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset)
textAcc->CopyText(aStartOffset, aEndOffset);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -55,15 +49,11 @@ ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset)
textAcc->DeleteText(aStartOffset, aEndOffset);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText)
{
A11Y_TRYBLOCK_BEGIN
uint32_t length = ::SysStringLen(*aText);
nsAutoString text(*aText, length);
MOZ_ASSERT(!HyperTextProxyFor(this));
@ -77,15 +67,11 @@ ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText)
textAcc->InsertText(text, aOffset);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -97,15 +83,11 @@ ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset)
textAcc->CutText(aStartOffset, aEndOffset);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleEditableText::pasteText(long aOffset)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -117,16 +99,12 @@ ia2AccessibleEditableText::pasteText(long aOffset)
textAcc->PasteText(aOffset);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleEditableText::replaceText(long aStartOffset, long aEndOffset,
BSTR *aText)
{
A11Y_TRYBLOCK_BEGIN
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
if (textAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
@ -141,8 +119,6 @@ ia2AccessibleEditableText::replaceText(long aStartOffset, long aEndOffset,
textAcc->InsertText(text, aStartOffset);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP

View File

@ -45,8 +45,6 @@ ia2AccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ia2AccessibleHyperlink::get_anchor(long aIndex, VARIANT* aAnchor)
{
A11Y_TRYBLOCK_BEGIN
if (!aAnchor)
return E_INVALIDARG;
@ -77,15 +75,11 @@ ia2AccessibleHyperlink::get_anchor(long aIndex, VARIANT* aAnchor)
aAnchor->punkVal = static_cast<IUnknown*>(instancePtr);
aAnchor->vt = VT_UNKNOWN;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget)
{
A11Y_TRYBLOCK_BEGIN
if (!aAnchorTarget) {
return E_INVALIDARG;
}
@ -124,15 +118,11 @@ ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget)
aAnchorTarget->bstrVal = ::SysAllocStringLen(stringURI.get(),
stringURI.Length());
return aAnchorTarget->bstrVal ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleHyperlink::get_startIndex(long* aIndex)
{
A11Y_TRYBLOCK_BEGIN
if (!aIndex)
return E_INVALIDARG;
@ -149,15 +139,11 @@ ia2AccessibleHyperlink::get_startIndex(long* aIndex)
*aIndex = thisObj->StartOffset();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleHyperlink::get_endIndex(long* aIndex)
{
A11Y_TRYBLOCK_BEGIN
if (!aIndex)
return E_INVALIDARG;
@ -174,15 +160,11 @@ ia2AccessibleHyperlink::get_endIndex(long* aIndex)
*aIndex = thisObj->EndOffset();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleHyperlink::get_valid(boolean* aValid)
{
A11Y_TRYBLOCK_BEGIN
if (!aValid)
return E_INVALIDARG;
@ -199,7 +181,5 @@ ia2AccessibleHyperlink::get_valid(boolean* aValid)
*aValid = thisObj->IsLinkValid();
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -19,8 +19,6 @@ using namespace mozilla::a11y;
STDMETHODIMP
ia2AccessibleHypertext::get_nHyperlinks(long* aHyperlinkCount)
{
A11Y_TRYBLOCK_BEGIN
if (!aHyperlinkCount)
return E_INVALIDARG;
@ -34,16 +32,12 @@ ia2AccessibleHypertext::get_nHyperlinks(long* aHyperlinkCount)
*aHyperlinkCount = hyperText->LinkCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleHypertext::get_hyperlink(long aLinkIndex,
IAccessibleHyperlink** aHyperlink)
{
A11Y_TRYBLOCK_BEGIN
if (!aHyperlink)
return E_INVALIDARG;
@ -65,15 +59,11 @@ ia2AccessibleHypertext::get_hyperlink(long aLinkIndex,
static_cast<IAccessibleHyperlink*>(hyperLink);
(*aHyperlink)->AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleHypertext::get_hyperlinkIndex(long aCharIndex, long* aHyperlinkIndex)
{
A11Y_TRYBLOCK_BEGIN
if (!aHyperlinkIndex)
return E_INVALIDARG;
@ -87,7 +77,5 @@ ia2AccessibleHypertext::get_hyperlinkIndex(long aCharIndex, long* aHyperlinkInde
*aHyperlinkIndex = hyperAcc->LinkIndexAtOffset(aCharIndex);
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -43,8 +43,6 @@ ia2AccessibleImage::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ia2AccessibleImage::get_description(BSTR* aDescription)
{
A11Y_TRYBLOCK_BEGIN
if (!aDescription)
return E_INVALIDARG;
@ -61,8 +59,6 @@ ia2AccessibleImage::get_description(BSTR* aDescription)
*aDescription = ::SysAllocStringLen(description.get(), description.Length());
return *aDescription ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -70,8 +66,6 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType,
long* aX,
long* aY)
{
A11Y_TRYBLOCK_BEGIN
if (!aX || !aY)
return E_INVALIDARG;
@ -90,15 +84,11 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType,
*aX = pos.x;
*aY = pos.y;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth)
{
A11Y_TRYBLOCK_BEGIN
if (!aHeight || !aWidth)
return E_INVALIDARG;
@ -113,7 +103,5 @@ ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth)
*aHeight = size.width;
*aWidth = size.height;
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -34,8 +34,6 @@ IMPL_IUNKNOWN_QUERY_TAIL
STDMETHODIMP
ia2AccessibleRelation::get_relationType(BSTR* aRelationType)
{
A11Y_TRYBLOCK_BEGIN
if (!aRelationType)
return E_INVALIDARG;
@ -51,43 +49,31 @@ ia2AccessibleRelation::get_relationType(BSTR* aRelationType)
}
return *aRelationType ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleRelation::get_localizedRelationType(BSTR *aLocalizedRelationType)
{
A11Y_TRYBLOCK_BEGIN
if (!aLocalizedRelationType)
return E_INVALIDARG;
*aLocalizedRelationType = nullptr;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleRelation::get_nTargets(long *aNTargets)
{
A11Y_TRYBLOCK_BEGIN
if (!aNTargets)
return E_INVALIDARG;
*aNTargets = mTargets.Length();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget)
{
A11Y_TRYBLOCK_BEGIN
if (aTargetIndex < 0 || (uint32_t)aTargetIndex >= mTargets.Length() || !aTarget)
return E_INVALIDARG;
@ -97,16 +83,12 @@ ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget)
(*aTarget)->AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets,
long *aNTargets)
{
A11Y_TRYBLOCK_BEGIN
if (!aNTargets || !aTargets)
return E_INVALIDARG;
@ -120,6 +102,4 @@ ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets,
*aNTargets = maxTargets;
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -60,8 +60,6 @@ ia2AccessibleTable::get_accessibleAt(long aRowIdx, long aColIdx,
STDMETHODIMP
ia2AccessibleTable::get_caption(IUnknown** aAccessible)
{
A11Y_TRYBLOCK_BEGIN
if (!aAccessible)
return E_INVALIDARG;
@ -75,16 +73,12 @@ ia2AccessibleTable::get_caption(IUnknown** aAccessible)
(*aAccessible = static_cast<IAccessible*>(caption))->AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_childIndex(long aRowIdx, long aColIdx,
long* aChildIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!aChildIdx)
return E_INVALIDARG;
@ -99,15 +93,11 @@ ia2AccessibleTable::get_childIndex(long aRowIdx, long aColIdx,
*aChildIdx = mTable->CellIndexAt(aRowIdx, aColIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_columnDescription(long aColIdx, BSTR* aDescription)
{
A11Y_TRYBLOCK_BEGIN
if (!aDescription)
return E_INVALIDARG;
@ -125,16 +115,12 @@ ia2AccessibleTable::get_columnDescription(long aColIdx, BSTR* aDescription)
*aDescription = ::SysAllocStringLen(descr.get(), descr.Length());
return *aDescription ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_columnExtentAt(long aRowIdx, long aColIdx,
long* aSpan)
{
A11Y_TRYBLOCK_BEGIN
if (!aSpan)
return E_INVALIDARG;
@ -149,31 +135,23 @@ ia2AccessibleTable::get_columnExtentAt(long aRowIdx, long aColIdx,
*aSpan = mTable->ColExtentAt(aRowIdx, aColIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_columnHeader(IAccessibleTable** aAccessibleTable,
long* aStartingRowIndex)
{
A11Y_TRYBLOCK_BEGIN
if (!aAccessibleTable || !aStartingRowIndex)
return E_INVALIDARG;
*aAccessibleTable = nullptr;
*aStartingRowIndex = -1;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_columnIndex(long aCellIdx, long* aColIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!aColIdx)
return E_INVALIDARG;
@ -187,15 +165,11 @@ ia2AccessibleTable::get_columnIndex(long aCellIdx, long* aColIdx)
*aColIdx = mTable->ColIndexAt(aCellIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_nColumns(long* aColCount)
{
A11Y_TRYBLOCK_BEGIN
if (!aColCount)
return E_INVALIDARG;
@ -205,15 +179,11 @@ ia2AccessibleTable::get_nColumns(long* aColCount)
*aColCount = mTable->ColCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_nRows(long* aRowCount)
{
A11Y_TRYBLOCK_BEGIN
if (!aRowCount)
return E_INVALIDARG;
@ -223,8 +193,6 @@ ia2AccessibleTable::get_nRows(long* aRowCount)
*aRowCount = mTable->RowCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -236,8 +204,6 @@ ia2AccessibleTable::get_nSelectedChildren(long* aChildCount)
STDMETHODIMP
ia2AccessibleTable::get_nSelectedColumns(long* aColCount)
{
A11Y_TRYBLOCK_BEGIN
if (!aColCount)
return E_INVALIDARG;
@ -247,15 +213,11 @@ ia2AccessibleTable::get_nSelectedColumns(long* aColCount)
*aColCount = mTable->SelectedColCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_nSelectedRows(long* aRowCount)
{
A11Y_TRYBLOCK_BEGIN
if (!aRowCount)
return E_INVALIDARG;
@ -266,15 +228,11 @@ ia2AccessibleTable::get_nSelectedRows(long* aRowCount)
*aRowCount = mTable->SelectedRowCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_rowDescription(long aRowIdx, BSTR* aDescription)
{
A11Y_TRYBLOCK_BEGIN
if (!aDescription)
return E_INVALIDARG;
@ -292,15 +250,11 @@ ia2AccessibleTable::get_rowDescription(long aRowIdx, BSTR* aDescription)
*aDescription = ::SysAllocStringLen(descr.get(), descr.Length());
return *aDescription ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_rowExtentAt(long aRowIdx, long aColIdx, long* aSpan)
{
A11Y_TRYBLOCK_BEGIN
if (!aSpan)
return E_INVALIDARG;
@ -315,31 +269,23 @@ ia2AccessibleTable::get_rowExtentAt(long aRowIdx, long aColIdx, long* aSpan)
*aSpan = mTable->RowExtentAt(aRowIdx, aColIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_rowHeader(IAccessibleTable** aAccessibleTable,
long* aStartingColumnIndex)
{
A11Y_TRYBLOCK_BEGIN
if (!aAccessibleTable || !aStartingColumnIndex)
return E_INVALIDARG;
*aAccessibleTable = nullptr;
*aStartingColumnIndex = -1;
return E_NOTIMPL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_rowIndex(long aCellIdx, long* aRowIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!aRowIdx)
return E_INVALIDARG;
@ -353,16 +299,12 @@ ia2AccessibleTable::get_rowIndex(long aCellIdx, long* aRowIdx)
*aRowIdx = mTable->RowIndexAt(aCellIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
long* aNChildren)
{
A11Y_TRYBLOCK_BEGIN
if (!aChildren || !aNChildren)
return E_INVALIDARG;
@ -384,36 +326,24 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
(*aChildren)[i] = cellIndices[i];
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_selectedColumns(long aMaxColumns, long** aColumns,
long* aNColumns)
{
A11Y_TRYBLOCK_BEGIN
return get_selectedColumns(aColumns, aNColumns);
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_selectedRows(long aMaxRows, long** aRows, long* aNRows)
{
A11Y_TRYBLOCK_BEGIN
return get_selectedRows(aRows, aNRows);
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_summary(IUnknown** aAccessible)
{
A11Y_TRYBLOCK_BEGIN
if (!aAccessible)
return E_INVALIDARG;
@ -424,15 +354,11 @@ ia2AccessibleTable::get_summary(IUnknown** aAccessible)
*aAccessible = nullptr;
return S_FALSE;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_isColumnSelected(long aColIdx, boolean* aIsSelected)
{
A11Y_TRYBLOCK_BEGIN
if (!aIsSelected)
return E_INVALIDARG;
@ -445,15 +371,11 @@ ia2AccessibleTable::get_isColumnSelected(long aColIdx, boolean* aIsSelected)
*aIsSelected = mTable->IsColSelected(aColIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_isRowSelected(long aRowIdx, boolean* aIsSelected)
{
A11Y_TRYBLOCK_BEGIN
if (!aIsSelected)
return E_INVALIDARG;
@ -466,16 +388,12 @@ ia2AccessibleTable::get_isRowSelected(long aRowIdx, boolean* aIsSelected)
*aIsSelected = mTable->IsRowSelected(aRowIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_isSelected(long aRowIdx, long aColIdx,
boolean* aIsSelected)
{
A11Y_TRYBLOCK_BEGIN
if (!aIsSelected)
return E_INVALIDARG;
@ -490,15 +408,11 @@ ia2AccessibleTable::get_isSelected(long aRowIdx, long aColIdx,
*aIsSelected = mTable->IsCellSelected(aRowIdx, aColIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::selectRow(long aRowIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!mTable)
return CO_E_OBJNOTCONNECTED;
@ -507,15 +421,11 @@ ia2AccessibleTable::selectRow(long aRowIdx)
mTable->SelectRow(aRowIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::selectColumn(long aColIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!mTable)
return CO_E_OBJNOTCONNECTED;
@ -524,15 +434,11 @@ ia2AccessibleTable::selectColumn(long aColIdx)
mTable->SelectCol(aColIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::unselectRow(long aRowIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!mTable)
return CO_E_OBJNOTCONNECTED;
@ -541,15 +447,11 @@ ia2AccessibleTable::unselectRow(long aRowIdx)
mTable->UnselectRow(aRowIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::unselectColumn(long aColIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!mTable)
return CO_E_OBJNOTCONNECTED;
@ -558,8 +460,6 @@ ia2AccessibleTable::unselectColumn(long aColIdx)
mTable->UnselectCol(aColIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -569,8 +469,6 @@ ia2AccessibleTable::get_rowColumnExtentsAtIndex(long aCellIdx, long* aRowIdx,
long* aColExtents,
boolean* aIsSelected)
{
A11Y_TRYBLOCK_BEGIN
if (!aRowIdx || !aColIdx || !aRowExtents || !aColExtents || !aIsSelected)
return E_INVALIDARG;
@ -595,8 +493,6 @@ ia2AccessibleTable::get_rowColumnExtentsAtIndex(long aCellIdx, long* aRowIdx,
*aIsSelected = mTable->IsCellSelected(rowIdx, colIdx);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -611,8 +507,6 @@ ia2AccessibleTable::get_modelChange(IA2TableModelChange* aModelChange)
STDMETHODIMP
ia2AccessibleTable::get_cellAt(long aRowIdx, long aColIdx, IUnknown** aCell)
{
A11Y_TRYBLOCK_BEGIN
if (!aCell)
return E_INVALIDARG;
@ -628,15 +522,11 @@ ia2AccessibleTable::get_cellAt(long aRowIdx, long aColIdx, IUnknown** aCell)
(*aCell = static_cast<IAccessible*>(cell))->AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_nSelectedCells(long* aCellCount)
{
A11Y_TRYBLOCK_BEGIN
if (!aCellCount)
return E_INVALIDARG;
@ -646,15 +536,11 @@ ia2AccessibleTable::get_nSelectedCells(long* aCellCount)
*aCellCount = mTable->SelectedCellCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
{
A11Y_TRYBLOCK_BEGIN
if (!aCells || !aNSelectedCells)
return E_INVALIDARG;
@ -682,15 +568,11 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
*aNSelectedCells = cells.Length();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
{
A11Y_TRYBLOCK_BEGIN
if (!aColumns || !aNColumns)
return E_INVALIDARG;
@ -712,15 +594,11 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
(*aColumns)[i] = colIndices[i];
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
{
A11Y_TRYBLOCK_BEGIN
if (!aRows || !aNRows)
return E_INVALIDARG;
@ -742,6 +620,4 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
(*aRows)[i] = rowIndices[i];
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -46,8 +46,6 @@ ia2AccessibleTableCell::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ia2AccessibleTableCell::get_table(IUnknown** aTable)
{
A11Y_TRYBLOCK_BEGIN
if (!aTable)
return E_INVALIDARG;
@ -63,15 +61,11 @@ ia2AccessibleTableCell::get_table(IUnknown** aTable)
*aTable = static_cast<IAccessible*>(wrap);
(*aTable)->AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTableCell::get_columnExtent(long* aSpan)
{
A11Y_TRYBLOCK_BEGIN
if (!aSpan)
return E_INVALIDARG;
@ -82,16 +76,12 @@ ia2AccessibleTableCell::get_columnExtent(long* aSpan)
*aSpan = mTableCell->ColExtent();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
long* aNColumnHeaderCells)
{
A11Y_TRYBLOCK_BEGIN
if (!aCellAccessibles || !aNColumnHeaderCells)
return E_INVALIDARG;
@ -118,15 +108,11 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTableCell::get_columnIndex(long* aColIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!aColIdx)
return E_INVALIDARG;
@ -136,15 +122,11 @@ ia2AccessibleTableCell::get_columnIndex(long* aColIdx)
*aColIdx = mTableCell->ColIdx();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTableCell::get_rowExtent(long* aSpan)
{
A11Y_TRYBLOCK_BEGIN
if (!aSpan)
return E_INVALIDARG;
@ -154,16 +136,12 @@ ia2AccessibleTableCell::get_rowExtent(long* aSpan)
*aSpan = mTableCell->RowExtent();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
long* aNRowHeaderCells)
{
A11Y_TRYBLOCK_BEGIN
if (!aCellAccessibles || !aNRowHeaderCells)
return E_INVALIDARG;
@ -189,15 +167,11 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTableCell::get_rowIndex(long* aRowIdx)
{
A11Y_TRYBLOCK_BEGIN
if (!aRowIdx)
return E_INVALIDARG;
@ -207,8 +181,6 @@ ia2AccessibleTableCell::get_rowIndex(long* aRowIdx)
*aRowIdx = mTableCell->RowIdx();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -217,8 +189,6 @@ ia2AccessibleTableCell::get_rowColumnExtents(long* aRowIdx, long* aColIdx,
long* aColExtents,
boolean* aIsSelected)
{
A11Y_TRYBLOCK_BEGIN
if (!aRowIdx || !aColIdx || !aRowExtents || !aColExtents || !aIsSelected)
return E_INVALIDARG;
@ -234,15 +204,11 @@ ia2AccessibleTableCell::get_rowColumnExtents(long* aRowIdx, long* aColIdx,
*aIsSelected = mTableCell->Selected();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleTableCell::get_isSelected(boolean* aIsSelected)
{
A11Y_TRYBLOCK_BEGIN
if (!aIsSelected)
return E_INVALIDARG;
@ -252,6 +218,4 @@ ia2AccessibleTableCell::get_isSelected(boolean* aIsSelected)
*aIsSelected = mTableCell->Selected();
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -28,8 +28,6 @@ bool ia2AccessibleText::sLastTextChangeWasInsert = false;
STDMETHODIMP
ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -38,16 +36,12 @@ ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset)
return textAcc->AddToSelection(aStartOffset, aEndOffset) ?
S_OK : E_INVALIDARG;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
long *aEndOffset, BSTR *aTextAttributes)
{
A11Y_TRYBLOCK_BEGIN
if (!aStartOffset || !aEndOffset || !aTextAttributes)
return E_INVALIDARG;
@ -74,15 +68,11 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
*aEndOffset = endOffset;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_caretOffset(long *aOffset)
{
A11Y_TRYBLOCK_BEGIN
if (!aOffset)
return E_INVALIDARG;
@ -97,8 +87,6 @@ ia2AccessibleText::get_caretOffset(long *aOffset)
*aOffset = textAcc->CaretOffset();
return *aOffset != -1 ? S_OK : S_FALSE;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -107,8 +95,6 @@ ia2AccessibleText::get_characterExtents(long aOffset,
long* aX, long* aY,
long* aWidth, long* aHeight)
{
A11Y_TRYBLOCK_BEGIN
if (!aX || !aY || !aWidth || !aHeight)
return E_INVALIDARG;
*aX = *aY = *aWidth = *aHeight = 0;
@ -129,15 +115,11 @@ ia2AccessibleText::get_characterExtents(long aOffset,
*aWidth = rect.width;
*aHeight = rect.height;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_nSelections(long* aNSelections)
{
A11Y_TRYBLOCK_BEGIN
if (!aNSelections)
return E_INVALIDARG;
*aNSelections = 0;
@ -151,8 +133,6 @@ ia2AccessibleText::get_nSelections(long* aNSelections)
*aNSelections = textAcc->SelectionCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -160,8 +140,6 @@ ia2AccessibleText::get_offsetAtPoint(long aX, long aY,
enum IA2CoordinateType aCoordType,
long* aOffset)
{
A11Y_TRYBLOCK_BEGIN
if (!aOffset)
return E_INVALIDARG;
*aOffset = 0;
@ -179,16 +157,12 @@ ia2AccessibleText::get_offsetAtPoint(long aX, long aY,
*aOffset = textAcc->OffsetAtPoint(aX, aY, geckoCoordType);
return *aOffset == -1 ? S_FALSE : S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset,
long* aEndOffset)
{
A11Y_TRYBLOCK_BEGIN
if (!aStartOffset || !aEndOffset)
return E_INVALIDARG;
*aStartOffset = *aEndOffset = 0;
@ -207,15 +181,11 @@ ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset,
*aStartOffset = startOffset;
*aEndOffset = endOffset;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_text(long aStartOffset, long aEndOffset, BSTR* aText)
{
A11Y_TRYBLOCK_BEGIN
if (!aText)
return E_INVALIDARG;
@ -239,8 +209,6 @@ ia2AccessibleText::get_text(long aStartOffset, long aEndOffset, BSTR* aText)
*aText = ::SysAllocStringLen(text.get(), text.Length());
return *aText ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -249,8 +217,6 @@ ia2AccessibleText::get_textBeforeOffset(long aOffset,
long* aStartOffset, long* aEndOffset,
BSTR* aText)
{
A11Y_TRYBLOCK_BEGIN
if (!aStartOffset || !aEndOffset || !aText)
return E_INVALIDARG;
@ -287,8 +253,6 @@ ia2AccessibleText::get_textBeforeOffset(long aOffset,
*aText = ::SysAllocStringLen(text.get(), text.Length());
return *aText ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -297,8 +261,6 @@ ia2AccessibleText::get_textAfterOffset(long aOffset,
long* aStartOffset, long* aEndOffset,
BSTR* aText)
{
A11Y_TRYBLOCK_BEGIN
if (!aStartOffset || !aEndOffset || !aText)
return E_INVALIDARG;
@ -335,8 +297,6 @@ ia2AccessibleText::get_textAfterOffset(long aOffset,
*aText = ::SysAllocStringLen(text.get(), text.Length());
return *aText ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -345,8 +305,6 @@ ia2AccessibleText::get_textAtOffset(long aOffset,
long* aStartOffset, long* aEndOffset,
BSTR* aText)
{
A11Y_TRYBLOCK_BEGIN
if (!aStartOffset || !aEndOffset || !aText)
return E_INVALIDARG;
@ -381,15 +339,11 @@ ia2AccessibleText::get_textAtOffset(long aOffset,
*aText = ::SysAllocStringLen(text.get(), text.Length());
return *aText ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::removeSelection(long aSelectionIndex)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -398,15 +352,11 @@ ia2AccessibleText::removeSelection(long aSelectionIndex)
return textAcc->RemoveFromSelection(aSelectionIndex) ?
S_OK : E_INVALIDARG;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::setCaretOffset(long aOffset)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -418,16 +368,12 @@ ia2AccessibleText::setCaretOffset(long aOffset)
textAcc->SetCaretOffset(aOffset);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset,
long aEndOffset)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -436,15 +382,11 @@ ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset,
return textAcc->SetSelectionBoundsAt(aSelectionIndex, aStartOffset, aEndOffset) ?
S_OK : E_INVALIDARG;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_nCharacters(long* aNCharacters)
{
A11Y_TRYBLOCK_BEGIN
if (!aNCharacters)
return E_INVALIDARG;
*aNCharacters = 0;
@ -457,16 +399,12 @@ ia2AccessibleText::get_nCharacters(long* aNCharacters)
*aNCharacters = textAcc->CharacterCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex,
enum IA2ScrollType aScrollType)
{
A11Y_TRYBLOCK_BEGIN
MOZ_ASSERT(!HyperTextProxyFor(this));
HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this);
@ -478,8 +416,6 @@ ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex,
textAcc->ScrollSubstringTo(aStartIndex, aEndIndex, aScrollType);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -487,8 +423,6 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex,
enum IA2CoordinateType aCoordType,
long aX, long aY)
{
A11Y_TRYBLOCK_BEGIN
uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ?
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE;
@ -505,28 +439,18 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex,
textAcc->ScrollSubstringToPoint(aStartIndex, aEndIndex,
geckoCoordType, aX, aY);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_newText(IA2TextSegment *aNewText)
{
A11Y_TRYBLOCK_BEGIN
return GetModifiedText(true, aNewText);
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleText::get_oldText(IA2TextSegment *aOldText)
{
A11Y_TRYBLOCK_BEGIN
return GetModifiedText(false, aOldText);
A11Y_TRYBLOCK_END
}
// ia2AccessibleText

View File

@ -46,8 +46,6 @@ ia2AccessibleValue::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ia2AccessibleValue::get_currentValue(VARIANT* aCurrentValue)
{
A11Y_TRYBLOCK_BEGIN
if (!aCurrentValue)
return E_INVALIDARG;
@ -68,15 +66,11 @@ ia2AccessibleValue::get_currentValue(VARIANT* aCurrentValue)
aCurrentValue->vt = VT_R8;
aCurrentValue->dblVal = currentValue;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleValue::setCurrentValue(VARIANT aValue)
{
A11Y_TRYBLOCK_BEGIN
if (aValue.vt != VT_R8)
return E_INVALIDARG;
@ -87,15 +81,11 @@ ia2AccessibleValue::setCurrentValue(VARIANT aValue)
return CO_E_OBJNOTCONNECTED;
return valueAcc->SetCurValue(aValue.dblVal) ? S_OK : E_FAIL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue)
{
A11Y_TRYBLOCK_BEGIN
if (!aMaximumValue)
return E_INVALIDARG;
@ -116,15 +106,11 @@ ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue)
aMaximumValue->vt = VT_R8;
aMaximumValue->dblVal = maximumValue;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ia2AccessibleValue::get_minimumValue(VARIANT* aMinimumValue)
{
A11Y_TRYBLOCK_BEGIN
if (!aMinimumValue)
return E_INVALIDARG;
@ -145,7 +131,5 @@ ia2AccessibleValue::get_minimumValue(VARIANT* aMinimumValue)
aMinimumValue->vt = VT_R8;
aMinimumValue->dblVal = minimumValue;
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -108,8 +108,6 @@ AccessibleWrap::Shutdown()
STDMETHODIMP
AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
{
A11Y_TRYBLOCK_BEGIN
if (!ppv)
return E_INVALIDARG;
@ -169,8 +167,6 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
(reinterpret_cast<IUnknown*>(*ppv))->AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}
//-----------------------------------------------------
@ -180,8 +176,6 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
AccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
{
A11Y_TRYBLOCK_BEGIN
if (!ppdispParent)
return E_INVALIDARG;
@ -212,15 +206,11 @@ AccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent)
*ppdispParent = NativeAccessible(xpParentAcc);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
AccessibleWrap::get_accChildCount( long __RPC_FAR *pcountChildren)
{
A11Y_TRYBLOCK_BEGIN
if (!pcountChildren)
return E_INVALIDARG;
@ -234,8 +224,6 @@ AccessibleWrap::get_accChildCount( long __RPC_FAR *pcountChildren)
*pcountChildren = ChildCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -243,8 +231,6 @@ AccessibleWrap::get_accChild(
/* [in] */ VARIANT varChild,
/* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispChild)
{
A11Y_TRYBLOCK_BEGIN
if (!ppdispChild)
return E_INVALIDARG;
@ -269,8 +255,6 @@ AccessibleWrap::get_accChild(
child.forget(ppdispChild);
return S_OK;
A11Y_TRYBLOCK_END
}
/**
@ -335,8 +319,6 @@ AccessibleWrap::get_accName(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR __RPC_FAR *pszName)
{
A11Y_TRYBLOCK_BEGIN
if (!pszName || varChild.vt != VT_I4)
return E_INVALIDARG;
@ -365,8 +347,6 @@ AccessibleWrap::get_accName(
if (!*pszName)
return E_OUTOFMEMORY;
return S_OK;
A11Y_TRYBLOCK_END
}
@ -375,8 +355,6 @@ AccessibleWrap::get_accValue(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR __RPC_FAR *pszValue)
{
A11Y_TRYBLOCK_BEGIN
if (!pszValue)
return E_INVALIDARG;
@ -405,16 +383,12 @@ AccessibleWrap::get_accValue(
if (!*pszValue)
return E_OUTOFMEMORY;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
AccessibleWrap::get_accDescription(VARIANT varChild,
BSTR __RPC_FAR *pszDescription)
{
A11Y_TRYBLOCK_BEGIN
if (!pszDescription)
return E_INVALIDARG;
@ -436,8 +410,6 @@ AccessibleWrap::get_accDescription(VARIANT varChild,
*pszDescription = ::SysAllocStringLen(description.get(),
description.Length());
return *pszDescription ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -445,8 +417,6 @@ AccessibleWrap::get_accRole(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT __RPC_FAR *pvarRole)
{
A11Y_TRYBLOCK_BEGIN
if (!pvarRole)
return E_INVALIDARG;
@ -536,8 +506,6 @@ AccessibleWrap::get_accRole(
}
return E_FAIL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -545,8 +513,6 @@ AccessibleWrap::get_accState(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ VARIANT __RPC_FAR *pvarState)
{
A11Y_TRYBLOCK_BEGIN
if (!pvarState)
return E_INVALIDARG;
@ -578,8 +544,6 @@ AccessibleWrap::get_accState(
nsAccUtils::To32States(state, &msaaState, nullptr);
pvarState->lVal = msaaState;
return S_OK;
A11Y_TRYBLOCK_END
}
@ -588,15 +552,11 @@ AccessibleWrap::get_accHelp(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR __RPC_FAR *pszHelp)
{
A11Y_TRYBLOCK_BEGIN
if (!pszHelp)
return E_INVALIDARG;
*pszHelp = nullptr;
return S_FALSE;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -605,16 +565,12 @@ AccessibleWrap::get_accHelpTopic(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ long __RPC_FAR *pidTopic)
{
A11Y_TRYBLOCK_BEGIN
if (!pszHelpFile || !pidTopic)
return E_INVALIDARG;
*pszHelpFile = nullptr;
*pidTopic = 0;
return S_FALSE;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -622,8 +578,6 @@ AccessibleWrap::get_accKeyboardShortcut(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR __RPC_FAR *pszKeyboardShortcut)
{
A11Y_TRYBLOCK_BEGIN
if (!pszKeyboardShortcut)
return E_INVALIDARG;
*pszKeyboardShortcut = nullptr;
@ -649,16 +603,12 @@ AccessibleWrap::get_accKeyboardShortcut(
*pszKeyboardShortcut = ::SysAllocStringLen(shortcut.get(),
shortcut.Length());
return *pszKeyboardShortcut ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
AccessibleWrap::get_accFocus(
/* [retval][out] */ VARIANT __RPC_FAR *pvarChild)
{
A11Y_TRYBLOCK_BEGIN
if (!pvarChild)
return E_INVALIDARG;
@ -689,8 +639,6 @@ AccessibleWrap::get_accFocus(
}
return S_OK;
A11Y_TRYBLOCK_END
}
/**
@ -727,8 +675,6 @@ private:
STDMETHODIMP
AccessibleEnumerator::QueryInterface(REFIID iid, void ** ppvObject)
{
A11Y_TRYBLOCK_BEGIN
if (iid == IID_IEnumVARIANT) {
*ppvObject = static_cast<IEnumVARIANT*>(this);
AddRef();
@ -742,15 +688,11 @@ AccessibleEnumerator::QueryInterface(REFIID iid, void ** ppvObject)
*ppvObject = nullptr;
return E_NOINTERFACE;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
AccessibleEnumerator::Next(unsigned long celt, VARIANT FAR* rgvar, unsigned long FAR* pceltFetched)
{
A11Y_TRYBLOCK_BEGIN
uint32_t length = mArray.Length();
HRESULT hr = S_OK;
@ -770,29 +712,21 @@ AccessibleEnumerator::Next(unsigned long celt, VARIANT FAR* rgvar, unsigned long
*pceltFetched = celt;
return hr;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
AccessibleEnumerator::Clone(IEnumVARIANT FAR* FAR* ppenum)
{
A11Y_TRYBLOCK_BEGIN
*ppenum = new AccessibleEnumerator(*this);
if (!*ppenum)
return E_OUTOFMEMORY;
NS_ADDREF(*ppenum);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
AccessibleEnumerator::Skip(unsigned long celt)
{
A11Y_TRYBLOCK_BEGIN
uint32_t length = mArray.Length();
// Check if we can skip the requested number of elements
if (celt > length - mCurIndex) {
@ -801,8 +735,6 @@ AccessibleEnumerator::Skip(unsigned long celt)
}
mCurIndex += celt;
return S_OK;
A11Y_TRYBLOCK_END
}
/**
@ -825,8 +757,6 @@ AccessibleEnumerator::Skip(unsigned long celt)
STDMETHODIMP
AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
{
A11Y_TRYBLOCK_BEGIN
if (!pvarChildren)
return E_INVALIDARG;
@ -846,8 +776,6 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
NS_ADDREF(pvarChildren->punkVal = pEnum);
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -855,8 +783,6 @@ AccessibleWrap::get_accDefaultAction(
/* [optional][in] */ VARIANT varChild,
/* [retval][out] */ BSTR __RPC_FAR *pszDefaultAction)
{
A11Y_TRYBLOCK_BEGIN
if (!pszDefaultAction)
return E_INVALIDARG;
@ -878,8 +804,6 @@ AccessibleWrap::get_accDefaultAction(
*pszDefaultAction = ::SysAllocStringLen(defaultAction.get(),
defaultAction.Length());
return *pszDefaultAction ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -887,8 +811,6 @@ AccessibleWrap::accSelect(
/* [in] */ long flagsSelect,
/* [optional][in] */ VARIANT varChild)
{
A11Y_TRYBLOCK_BEGIN
RefPtr<IAccessible> accessible;
HRESULT hr = ResolveChild(varChild, getter_AddRefs(accessible));
if (FAILED(hr)) {
@ -930,8 +852,6 @@ AccessibleWrap::accSelect(
}
return E_FAIL;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -942,8 +862,6 @@ AccessibleWrap::accLocation(
/* [out] */ long __RPC_FAR *pcyHeight,
/* [optional][in] */ VARIANT varChild)
{
A11Y_TRYBLOCK_BEGIN
if (!pxLeft || !pyTop || !pcxWidth || !pcyHeight)
return E_INVALIDARG;
@ -970,8 +888,6 @@ AccessibleWrap::accLocation(
*pcxWidth = rect.width;
*pcyHeight = rect.height;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -980,8 +896,6 @@ AccessibleWrap::accNavigate(
/* [optional][in] */ VARIANT varStart,
/* [retval][out] */ VARIANT __RPC_FAR *pvarEndUpAt)
{
A11Y_TRYBLOCK_BEGIN
if (!pvarEndUpAt)
return E_INVALIDARG;
@ -1064,8 +978,6 @@ AccessibleWrap::accNavigate(
pvarEndUpAt->pdispVal = NativeAccessible(navAccessible);
pvarEndUpAt->vt = VT_DISPATCH;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -1074,8 +986,6 @@ AccessibleWrap::accHitTest(
/* [in] */ long yTop,
/* [retval][out] */ VARIANT __RPC_FAR *pvarChild)
{
A11Y_TRYBLOCK_BEGIN
if (!pvarChild)
return E_INVALIDARG;
@ -1102,16 +1012,12 @@ AccessibleWrap::accHitTest(
return S_FALSE;
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
AccessibleWrap::accDoDefaultAction(
/* [optional][in] */ VARIANT varChild)
{
A11Y_TRYBLOCK_BEGIN
RefPtr<IAccessible> accessible;
HRESULT hr = ResolveChild(varChild, getter_AddRefs(accessible));
if (FAILED(hr)) {
@ -1123,8 +1029,6 @@ AccessibleWrap::accDoDefaultAction(
}
return DoAction(0) ? S_OK : E_INVALIDARG;
A11Y_TRYBLOCK_END
}
STDMETHODIMP

View File

@ -69,8 +69,6 @@ ApplicationAccessibleWrap::QueryInterface(REFIID iid, void** ppv)
STDMETHODIMP
ApplicationAccessibleWrap::get_appName(BSTR* aName)
{
A11Y_TRYBLOCK_BEGIN
if (!aName)
return E_INVALIDARG;
@ -86,15 +84,11 @@ ApplicationAccessibleWrap::get_appName(BSTR* aName)
*aName = ::SysAllocStringLen(name.get(), name.Length());
return *aName ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ApplicationAccessibleWrap::get_appVersion(BSTR* aVersion)
{
A11Y_TRYBLOCK_BEGIN
if (!aVersion)
return E_INVALIDARG;
@ -110,15 +104,11 @@ ApplicationAccessibleWrap::get_appVersion(BSTR* aVersion)
*aVersion = ::SysAllocStringLen(version.get(), version.Length());
return *aVersion ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ApplicationAccessibleWrap::get_toolkitName(BSTR* aName)
{
A11Y_TRYBLOCK_BEGIN
if (!aName)
return E_INVALIDARG;
@ -132,15 +122,11 @@ ApplicationAccessibleWrap::get_toolkitName(BSTR* aName)
*aName = ::SysAllocStringLen(name.get(), name.Length());
return *aName ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ApplicationAccessibleWrap::get_toolkitVersion(BSTR* aVersion)
{
A11Y_TRYBLOCK_BEGIN
if (!aVersion)
return E_INVALIDARG;
@ -156,7 +142,5 @@ ApplicationAccessibleWrap::get_toolkitVersion(BSTR* aVersion)
*aVersion = ::SysAllocStringLen(version.get(), version.Length());
return *aVersion ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}

View File

@ -66,8 +66,6 @@ DocAccessibleWrap::get_accParent(
STDMETHODIMP
DocAccessibleWrap::get_accValue(VARIANT aVarChild, BSTR __RPC_FAR* aValue)
{
A11Y_TRYBLOCK_BEGIN
if (!aValue)
return E_INVALIDARG;
*aValue = nullptr;
@ -91,8 +89,6 @@ DocAccessibleWrap::get_accValue(VARIANT aVarChild, BSTR __RPC_FAR* aValue)
*aValue = ::SysAllocStringLen(url.get(), url.Length());
return *aValue ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -21,8 +21,6 @@ STDMETHODIMP
ChildrenEnumVariant::Next(ULONG aCount, VARIANT FAR* aItems,
ULONG FAR* aCountFetched)
{
A11Y_TRYBLOCK_BEGIN
if (!aItems || !aCountFetched)
return E_INVALIDARG;
@ -55,15 +53,11 @@ ChildrenEnumVariant::Next(ULONG aCount, VARIANT FAR* aItems,
(*aCountFetched) = countFetched;
return countFetched < aCount ? S_FALSE : S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ChildrenEnumVariant::Skip(ULONG aCount)
{
A11Y_TRYBLOCK_BEGIN
if (mAnchorAcc->IsDefunct() || mAnchorAcc->GetChildAt(mCurIndex) != mCurAcc)
return CO_E_OBJNOTCONNECTED;
@ -71,15 +65,11 @@ ChildrenEnumVariant::Skip(ULONG aCount)
mCurAcc = mAnchorAcc->GetChildAt(mCurIndex);
return mCurAcc ? S_OK : S_FALSE;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ChildrenEnumVariant::Reset()
{
A11Y_TRYBLOCK_BEGIN
if (mAnchorAcc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
@ -87,15 +77,11 @@ ChildrenEnumVariant::Reset()
mCurAcc = mAnchorAcc->GetChildAt(0);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
ChildrenEnumVariant::Clone(IEnumVARIANT** aEnumVariant)
{
A11Y_TRYBLOCK_BEGIN
if (!aEnumVariant)
return E_INVALIDARG;
@ -103,6 +89,4 @@ ChildrenEnumVariant::Clone(IEnumVARIANT** aEnumVariant)
(*aEnumVariant)->AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -37,22 +37,5 @@ GetHRESULT(nsresult aResult)
}
}
int
FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo)
{
if (aCode == EXCEPTION_ACCESS_VIOLATION) {
#ifdef MOZ_CRASHREPORTER
// MSAA swallows crashes (because it is COM-based) but we still need to
// learn about those crashes so we can fix them. Make sure to pass them to
// the crash reporter.
CrashReporter::WriteMinidumpForException(aExceptionInfo);
#endif
} else {
NS_NOTREACHED("We should only be catching crash exceptions");
}
return EXCEPTION_CONTINUE_SEARCH;
}
} // namespace a11y
} // namespace mozilla

View File

@ -79,7 +79,6 @@ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**); \
STDMETHODIMP \
Class::QueryInterface(REFIID aIID, void** aInstancePtr) \
{ \
A11Y_TRYBLOCK_BEGIN \
if (!aInstancePtr) \
return E_INVALIDARG; \
*aInstancePtr = nullptr; \
@ -88,17 +87,14 @@ Class::QueryInterface(REFIID aIID, void** aInstancePtr) \
#define IMPL_IUNKNOWN_QUERY_TAIL \
return hr; \
A11Y_TRYBLOCK_END \
}
#define IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(Member) \
return Member->QueryInterface(aIID, aInstancePtr); \
A11Y_TRYBLOCK_END \
}
#define IMPL_IUNKNOWN_QUERY_TAIL_INHERITED(BaseClass) \
return BaseClass::QueryInterface(aIID, aInstancePtr); \
A11Y_TRYBLOCK_END \
}
#define IMPL_IUNKNOWN_QUERY_IFACE(Iface) \
@ -158,21 +154,6 @@ Class::QueryInterface(REFIID aIID, void** aInstancePtr) \
IMPL_IUNKNOWN_QUERY_CLASS(Super2); \
IMPL_IUNKNOWN_QUERY_TAIL_INHERITED(Super0)
/**
* Wrap every method body by these macroses to pass exception to the crash
* reporter.
*/
#define A11Y_TRYBLOCK_BEGIN \
MOZ_SEH_TRY {
#define A11Y_TRYBLOCK_END \
} MOZ_SEH_EXCEPT(mozilla::a11y::FilterExceptions(::GetExceptionCode(), \
GetExceptionInformation())) \
{ } \
return E_FAIL;
namespace mozilla {
namespace a11y {
@ -181,11 +162,6 @@ namespace a11y {
*/
HRESULT GetHRESULT(nsresult aResult);
/**
* Used to pass an exception to the crash reporter.
*/
int FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo);
} // namespace a11y;
} //namespace mozilla;

View File

@ -28,8 +28,6 @@ using namespace mozilla::a11y;
STDMETHODIMP
sdnAccessible::QueryInterface(REFIID aREFIID, void** aInstancePtr)
{
A11Y_TRYBLOCK_BEGIN
if (!aInstancePtr)
return E_FAIL;
*aInstancePtr = nullptr;
@ -53,8 +51,6 @@ sdnAccessible::QueryInterface(REFIID aREFIID, void** aInstancePtr)
}
return E_NOINTERFACE;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -65,8 +61,6 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName,
unsigned int __RPC_FAR* aUniqueID,
unsigned short __RPC_FAR* aNodeType)
{
A11Y_TRYBLOCK_BEGIN
if (!aNodeName || !aNameSpaceID || !aNodeValue || !aNumChildren ||
!aUniqueID || !aNodeType)
return E_INVALIDARG;
@ -114,8 +108,6 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName,
*aNumChildren = mNode->GetChildCount();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -125,8 +117,6 @@ sdnAccessible::get_attributes(unsigned short aMaxAttribs,
BSTR __RPC_FAR* aAttribValues,
unsigned short __RPC_FAR* aNumAttribs)
{
A11Y_TRYBLOCK_BEGIN
if (!aAttribNames || !aNameSpaceIDs || !aAttribValues || !aNumAttribs)
return E_INVALIDARG;
@ -159,8 +149,6 @@ sdnAccessible::get_attributes(unsigned short aMaxAttribs,
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -169,8 +157,6 @@ sdnAccessible::get_attributesForNames(unsigned short aMaxAttribs,
short __RPC_FAR* aNameSpaceID,
BSTR __RPC_FAR* aAttribValues)
{
A11Y_TRYBLOCK_BEGIN
if (!aAttribNames || !aNameSpaceID || !aAttribValues)
return E_INVALIDARG;
@ -207,8 +193,6 @@ sdnAccessible::get_attributesForNames(unsigned short aMaxAttribs,
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -218,8 +202,6 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties,
BSTR __RPC_FAR* aStyleValues,
unsigned short __RPC_FAR* aNumStyleProperties)
{
A11Y_TRYBLOCK_BEGIN
if (!aStyleProperties || aStyleValues || !aNumStyleProperties)
return E_INVALIDARG;
@ -257,8 +239,6 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties,
*aNumStyleProperties = static_cast<unsigned short>(realIndex);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -267,8 +247,6 @@ sdnAccessible::get_computedStyleForProperties(unsigned short aNumStyleProperties
BSTR __RPC_FAR* aStyleProperties,
BSTR __RPC_FAR* aStyleValues)
{
A11Y_TRYBLOCK_BEGIN
if (!aStyleProperties || !aStyleValues)
return E_INVALIDARG;
@ -291,15 +269,11 @@ sdnAccessible::get_computedStyleForProperties(unsigned short aNumStyleProperties
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::scrollTo(boolean aScrollTopLeft)
{
A11Y_TRYBLOCK_BEGIN
DocAccessible* document = GetDocument();
if (!document) // that's IsDefunct check
return CO_E_OBJNOTCONNECTED;
@ -313,15 +287,11 @@ sdnAccessible::scrollTo(boolean aScrollTopLeft)
nsCoreUtils::ScrollTo(document->PresShell(), mNode->AsContent(), scrollType);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
{
A11Y_TRYBLOCK_BEGIN
if (!aNode)
return E_INVALIDARG;
*aNode = nullptr;
@ -336,15 +306,11 @@ sdnAccessible::get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
{
A11Y_TRYBLOCK_BEGIN
if (!aNode)
return E_INVALIDARG;
*aNode = nullptr;
@ -359,15 +325,11 @@ sdnAccessible::get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
{
A11Y_TRYBLOCK_BEGIN
if (!aNode)
return E_INVALIDARG;
*aNode = nullptr;
@ -382,15 +344,11 @@ sdnAccessible::get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
{
A11Y_TRYBLOCK_BEGIN
if (!aNode)
return E_INVALIDARG;
*aNode = nullptr;
@ -405,15 +363,11 @@ sdnAccessible::get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
{
A11Y_TRYBLOCK_BEGIN
if (!aNode)
return E_INVALIDARG;
*aNode = nullptr;
@ -428,16 +382,12 @@ sdnAccessible::get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_childAt(unsigned aChildIndex,
ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode)
{
A11Y_TRYBLOCK_BEGIN
if (!aNode)
return E_INVALIDARG;
*aNode = nullptr;
@ -453,15 +403,11 @@ sdnAccessible::get_childAt(unsigned aChildIndex,
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_innerHTML(BSTR __RPC_FAR* aInnerHTML)
{
A11Y_TRYBLOCK_BEGIN
if (!aInnerHTML)
return E_INVALIDARG;
*aInnerHTML = nullptr;
@ -482,15 +428,11 @@ sdnAccessible::get_innerHTML(BSTR __RPC_FAR* aInnerHTML)
return E_OUTOFMEMORY;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_localInterface(void __RPC_FAR *__RPC_FAR* aLocalInterface)
{
A11Y_TRYBLOCK_BEGIN
if (!aLocalInterface)
return E_INVALIDARG;
*aLocalInterface = nullptr;
@ -502,15 +444,11 @@ sdnAccessible::get_localInterface(void __RPC_FAR *__RPC_FAR* aLocalInterface)
AddRef();
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnAccessible::get_language(BSTR __RPC_FAR* aLanguage)
{
A11Y_TRYBLOCK_BEGIN
if (!aLanguage)
return E_INVALIDARG;
*aLanguage = nullptr;
@ -534,6 +472,4 @@ sdnAccessible::get_language(BSTR __RPC_FAR* aLanguage)
return E_OUTOFMEMORY;
return S_OK;
A11Y_TRYBLOCK_END
}

View File

@ -24,8 +24,6 @@ IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAccessible)
STDMETHODIMP
sdnDocAccessible::get_URL(BSTR __RPC_FAR* aURL)
{
A11Y_TRYBLOCK_BEGIN
if (!aURL)
return E_INVALIDARG;
*aURL = nullptr;
@ -40,15 +38,11 @@ sdnDocAccessible::get_URL(BSTR __RPC_FAR* aURL)
*aURL = ::SysAllocStringLen(URL.get(), URL.Length());
return *aURL ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnDocAccessible::get_title(BSTR __RPC_FAR* aTitle)
{
A11Y_TRYBLOCK_BEGIN
if (!aTitle)
return E_INVALIDARG;
*aTitle = nullptr;
@ -60,15 +54,11 @@ sdnDocAccessible::get_title(BSTR __RPC_FAR* aTitle)
mAccessible->Title(title);
*aTitle = ::SysAllocStringLen(title.get(), title.Length());
return *aTitle ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnDocAccessible::get_mimeType(BSTR __RPC_FAR* aMimeType)
{
A11Y_TRYBLOCK_BEGIN
if (!aMimeType)
return E_INVALIDARG;
*aMimeType = nullptr;
@ -83,15 +73,11 @@ sdnDocAccessible::get_mimeType(BSTR __RPC_FAR* aMimeType)
*aMimeType = ::SysAllocStringLen(mimeType.get(), mimeType.Length());
return *aMimeType ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnDocAccessible::get_docType(BSTR __RPC_FAR* aDocType)
{
A11Y_TRYBLOCK_BEGIN
if (!aDocType)
return E_INVALIDARG;
*aDocType = nullptr;
@ -106,16 +92,12 @@ sdnDocAccessible::get_docType(BSTR __RPC_FAR* aDocType)
*aDocType = ::SysAllocStringLen(docType.get(), docType.Length());
return *aDocType ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnDocAccessible::get_nameSpaceURIForID(short aNameSpaceID,
BSTR __RPC_FAR* aNameSpaceURI)
{
A11Y_TRYBLOCK_BEGIN
if (!aNameSpaceURI)
return E_INVALIDARG;
*aNameSpaceURI = nullptr;
@ -138,20 +120,14 @@ sdnDocAccessible::get_nameSpaceURIForID(short aNameSpaceID,
nameSpaceURI.Length());
return *aNameSpaceURI ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnDocAccessible::put_alternateViewMediaTypes(BSTR __RPC_FAR* aCommaSeparatedMediaTypes)
{
A11Y_TRYBLOCK_BEGIN
if (!aCommaSeparatedMediaTypes)
return E_INVALIDARG;
*aCommaSeparatedMediaTypes = nullptr;
return mAccessible->IsDefunct() ? CO_E_OBJNOTCONNECTED : E_NOTIMPL;
A11Y_TRYBLOCK_END
}

View File

@ -33,8 +33,6 @@ IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAccessible)
STDMETHODIMP
sdnTextAccessible::get_domText(BSTR __RPC_FAR* aText)
{
A11Y_TRYBLOCK_BEGIN
if (!aText)
return E_INVALIDARG;
*aText = nullptr;
@ -51,8 +49,6 @@ sdnTextAccessible::get_domText(BSTR __RPC_FAR* aText)
*aText = ::SysAllocStringLen(nodeValue.get(), nodeValue.Length());
return *aText ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -63,8 +59,6 @@ sdnTextAccessible::get_clippedSubstringBounds(unsigned int aStartIndex,
int __RPC_FAR* aWidth,
int __RPC_FAR* aHeight)
{
A11Y_TRYBLOCK_BEGIN
nscoord x = 0, y = 0, width = 0, height = 0;
HRESULT rv = get_unclippedSubstringBounds(aStartIndex, aEndIndex,
&x, &y, &width, &height);
@ -86,8 +80,6 @@ sdnTextAccessible::get_clippedSubstringBounds(unsigned int aStartIndex,
*aWidth = clippedRect.width;
*aHeight = clippedRect.height;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
@ -98,8 +90,6 @@ sdnTextAccessible::get_unclippedSubstringBounds(unsigned int aStartIndex,
int __RPC_FAR* aWidth,
int __RPC_FAR* aHeight)
{
A11Y_TRYBLOCK_BEGIN
if (!aX || !aY || !aWidth || !aHeight)
return E_INVALIDARG;
*aX = *aY = *aWidth = *aHeight = 0;
@ -135,16 +125,12 @@ sdnTextAccessible::get_unclippedSubstringBounds(unsigned int aStartIndex,
*aHeight = presContext->AppUnitsToDevPixels(sum.height);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex,
unsigned int aEndIndex)
{
A11Y_TRYBLOCK_BEGIN
if (mAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;
@ -159,15 +145,11 @@ sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex,
nsCoreUtils::ScrollSubstringTo(mAccessible->GetFrame(), range,
nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE);
return GetHRESULT(rv);
A11Y_TRYBLOCK_END
}
STDMETHODIMP
sdnTextAccessible::get_fontFamily(BSTR __RPC_FAR* aFontFamily)
{
A11Y_TRYBLOCK_BEGIN
if (!aFontFamily)
return E_INVALIDARG;
*aFontFamily = nullptr;
@ -189,8 +171,6 @@ sdnTextAccessible::get_fontFamily(BSTR __RPC_FAR* aFontFamily)
*aFontFamily = ::SysAllocStringLen(name.get(), name.Length());
return *aFontFamily ? S_OK : E_OUTOFMEMORY;
A11Y_TRYBLOCK_END
}
nsIFrame*

View File

@ -28,24 +28,18 @@ STDMETHODIMP
uiaRawElmProvider::GetObjectForChild(long aIdChild,
__RPC__deref_out_opt IAccessibleEx** aAccEx)
{
A11Y_TRYBLOCK_BEGIN
if (!aAccEx)
return E_INVALIDARG;
*aAccEx = nullptr;
return mAcc->IsDefunct() ? CO_E_OBJNOTCONNECTED : S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
uiaRawElmProvider::GetIAccessiblePair(__RPC__deref_out_opt IAccessible** aAcc,
__RPC__out long* aIdChild)
{
A11Y_TRYBLOCK_BEGIN
if (!aAcc || !aIdChild)
return E_INVALIDARG;
@ -60,15 +54,11 @@ uiaRawElmProvider::GetIAccessiblePair(__RPC__deref_out_opt IAccessible** aAcc,
copy.forget(aAcc);
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds)
{
A11Y_TRYBLOCK_BEGIN
if (!aRuntimeIds)
return E_INVALIDARG;
@ -81,16 +71,12 @@ uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds)
SafeArrayPutElement(*aRuntimeIds, &i, (void*)&(ids[i]));
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimple* aRawElmProvider,
__RPC__deref_out_opt IAccessibleEx** aAccEx)
{
A11Y_TRYBLOCK_BEGIN
if (!aRawElmProvider || !aAccEx)
return E_INVALIDARG;
@ -102,8 +88,6 @@ uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimpl
*aAccEx = static_cast<IAccessibleEx*>(instancePtr);
return hr;
A11Y_TRYBLOCK_END
}
////////////////////////////////////////////////////////////////////////////////
@ -112,39 +96,29 @@ uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimpl
STDMETHODIMP
uiaRawElmProvider::get_ProviderOptions(__RPC__out enum ProviderOptions* aOptions)
{
A11Y_TRYBLOCK_BEGIN
if (!aOptions)
return E_INVALIDARG;
// This method is not used with IAccessibleEx implementations.
*aOptions = ProviderOptions_ServerSideProvider;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
uiaRawElmProvider::GetPatternProvider(PATTERNID aPatternId,
__RPC__deref_out_opt IUnknown** aPatternProvider)
{
A11Y_TRYBLOCK_BEGIN
if (!aPatternProvider)
return E_INVALIDARG;
*aPatternProvider = nullptr;
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
uiaRawElmProvider::GetPropertyValue(PROPERTYID aPropertyId,
__RPC__out VARIANT* aPropertyValue)
{
A11Y_TRYBLOCK_BEGIN
if (!aPropertyValue)
return E_INVALIDARG;
@ -226,21 +200,15 @@ uiaRawElmProvider::GetPropertyValue(PROPERTYID aPropertyId,
}
return S_OK;
A11Y_TRYBLOCK_END
}
STDMETHODIMP
uiaRawElmProvider::get_HostRawElementProvider(__RPC__deref_out_opt IRawElementProviderSimple** aRawElmProvider)
{
A11Y_TRYBLOCK_BEGIN
if (!aRawElmProvider)
return E_INVALIDARG;
// This method is not used with IAccessibleEx implementations.
*aRawElmProvider = nullptr;
return S_OK;
A11Y_TRYBLOCK_END
}