зеркало из https://github.com/mozilla/pjs.git
Bug 756087 - nsAccessible::GetChildCount should return unsigned int, r=tbsaunde
This commit is contained in:
Родитель
8471d399e0
Коммит
86351cb0d3
|
@ -792,7 +792,7 @@ getChildCountCB(AtkObject *aAtkObj)
|
|||
return 0;
|
||||
}
|
||||
|
||||
return accWrap->GetEmbeddedChildCount();
|
||||
return static_cast<gint>(accWrap->EmbeddedChildCount());
|
||||
}
|
||||
|
||||
AtkObject *
|
||||
|
|
|
@ -53,7 +53,7 @@ AccCollector::GetIndexAt(nsAccessible *aAccessible)
|
|||
nsAccessible*
|
||||
AccCollector::EnsureNGetObject(PRUint32 aIndex)
|
||||
{
|
||||
PRInt32 childCount = mRoot->GetChildCount();
|
||||
PRUint32 childCount = mRoot->ChildCount();
|
||||
while (mRootChildIdx < childCount) {
|
||||
nsAccessible* child = mRoot->GetChildAt(mRootChildIdx++);
|
||||
if (!mFilterFunc(child))
|
||||
|
@ -70,7 +70,7 @@ AccCollector::EnsureNGetObject(PRUint32 aIndex)
|
|||
PRInt32
|
||||
AccCollector::EnsureNGetIndex(nsAccessible* aAccessible)
|
||||
{
|
||||
PRInt32 childCount = mRoot->GetChildCount();
|
||||
PRUint32 childCount = mRoot->ChildCount();
|
||||
while (mRootChildIdx < childCount) {
|
||||
nsAccessible* child = mRoot->GetChildAt(mRootChildIdx++);
|
||||
if (!mFilterFunc(child))
|
||||
|
|
|
@ -53,7 +53,7 @@ protected:
|
|||
|
||||
filters::FilterFuncPtr mFilterFunc;
|
||||
nsAccessible* mRoot;
|
||||
PRInt32 mRootChildIdx;
|
||||
PRUint32 mRootChildIdx;
|
||||
|
||||
nsTArray<nsAccessible*> mObjects;
|
||||
|
||||
|
|
|
@ -18,8 +18,9 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) :
|
|||
return;
|
||||
|
||||
PRInt32 indexInParent = aItem->IndexInParent();
|
||||
PRInt32 siblingCount = parent->GetChildCount();
|
||||
if (siblingCount < indexInParent) {
|
||||
PRUint32 siblingCount = parent->ChildCount();
|
||||
if (indexInParent == -1 ||
|
||||
indexInParent >= static_cast<PRInt32>(siblingCount)) {
|
||||
NS_ERROR("Wrong index in parent! Tree invalidation problem.");
|
||||
return;
|
||||
}
|
||||
|
@ -28,7 +29,7 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) :
|
|||
|
||||
// Compute position in set.
|
||||
mPosInSet = 1;
|
||||
for (PRInt32 idx = indexInParent - 1; idx >=0 ; idx--) {
|
||||
for (PRInt32 idx = indexInParent - 1; idx >= 0 ; idx--) {
|
||||
nsAccessible* sibling = parent->GetChildAt(idx);
|
||||
roles::Role siblingRole = sibling->Role();
|
||||
|
||||
|
@ -69,7 +70,7 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) :
|
|||
// Compute set size.
|
||||
mSetSize = mPosInSet;
|
||||
|
||||
for (PRInt32 idx = indexInParent + 1; idx < siblingCount; idx++) {
|
||||
for (PRUint32 idx = indexInParent + 1; idx < siblingCount; idx++) {
|
||||
nsAccessible* sibling = parent->GetChildAt(idx);
|
||||
|
||||
roles::Role siblingRole = sibling->Role();
|
||||
|
|
|
@ -51,8 +51,8 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
|
|||
(*aStartHTOffset)--;
|
||||
}
|
||||
|
||||
PRInt32 childCount = mHyperTextAcc->GetChildCount();
|
||||
for (PRInt32 childIdx = mOffsetAccIdx + 1; childIdx < childCount;
|
||||
PRUint32 childCount = mHyperTextAcc->ChildCount();
|
||||
for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childCount;
|
||||
childIdx++) {
|
||||
nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
if (!nsAccUtils::IsEmbeddedObject(currAcc))
|
||||
|
@ -164,8 +164,8 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
|
|||
}
|
||||
|
||||
// Navigate forward from anchor accessible to find end offset.
|
||||
PRInt32 childLen = mHyperTextAcc->GetChildCount();
|
||||
for (PRInt32 childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
|
||||
PRUint32 childLen = mHyperTextAcc->ChildCount();
|
||||
for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
|
||||
nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx);
|
||||
if (nsAccUtils::IsEmbeddedObject(currAcc))
|
||||
break;
|
||||
|
|
|
@ -421,8 +421,8 @@ nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible* aAccessible)
|
|||
return true;
|
||||
|
||||
bool foundText = false;
|
||||
PRInt32 childCount = aAccessible->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = aAccessible->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = aAccessible->GetChildAt(childIdx);
|
||||
if (IsText(child)) {
|
||||
foundText = true;
|
||||
|
|
|
@ -486,12 +486,7 @@ nsAccessible::GetFirstChild(nsIAccessible **aFirstChild)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 childCount = GetChildCount();
|
||||
NS_ENSURE_TRUE(childCount != -1, NS_ERROR_FAILURE);
|
||||
|
||||
if (childCount > 0)
|
||||
NS_ADDREF(*aFirstChild = GetChildAt(0));
|
||||
|
||||
NS_IF_ADDREF(*aFirstChild = FirstChild());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -505,10 +500,7 @@ nsAccessible::GetLastChild(nsIAccessible **aLastChild)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 childCount = GetChildCount();
|
||||
NS_ENSURE_TRUE(childCount != -1, NS_ERROR_FAILURE);
|
||||
|
||||
NS_IF_ADDREF(*aLastChild = GetChildAt(childCount - 1));
|
||||
NS_IF_ADDREF(*aLastChild = LastChild());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -521,13 +513,10 @@ nsAccessible::GetChildAt(PRInt32 aChildIndex, nsIAccessible **aChild)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 childCount = GetChildCount();
|
||||
NS_ENSURE_TRUE(childCount != -1, NS_ERROR_FAILURE);
|
||||
|
||||
// If child index is negative, then return last child.
|
||||
// XXX: do we really need this?
|
||||
if (aChildIndex < 0)
|
||||
aChildIndex = childCount - 1;
|
||||
aChildIndex = ChildCount() - 1;
|
||||
|
||||
nsAccessible* child = GetChildAt(aChildIndex);
|
||||
if (!child)
|
||||
|
@ -547,15 +536,13 @@ nsAccessible::GetChildren(nsIArray **aOutChildren)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRInt32 childCount = GetChildCount();
|
||||
NS_ENSURE_TRUE(childCount != -1, NS_ERROR_FAILURE);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIMutableArray> children =
|
||||
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsIAccessible* child = GetChildAt(childIdx);
|
||||
children->AppendElement(child, false);
|
||||
}
|
||||
|
@ -579,8 +566,8 @@ nsAccessible::GetChildCount(PRInt32 *aChildCount)
|
|||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*aChildCount = GetChildCount();
|
||||
return *aChildCount != -1 ? NS_OK : NS_ERROR_FAILURE;
|
||||
*aChildCount = ChildCount();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute long indexInParent; */
|
||||
|
@ -815,9 +802,9 @@ nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
|
|||
// where layout won't walk into things for us, such as image map areas and
|
||||
// sub documents (XXX: subdocuments should be handled by methods of
|
||||
// OuterDocAccessibles).
|
||||
PRInt32 childCount = GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = GetChildAt(childIdx);
|
||||
PRUint32 childCount = ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = GetChildAt(childIdx);
|
||||
|
||||
PRInt32 childX, childY, childWidth, childHeight;
|
||||
child->GetBounds(&childX, &childY, &childWidth, &childHeight);
|
||||
|
@ -2670,8 +2657,8 @@ nsAccessible::GetChildAt(PRUint32 aIndex)
|
|||
return child;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsAccessible::GetChildCount()
|
||||
PRUint32
|
||||
nsAccessible::ChildCount() const
|
||||
{
|
||||
return mChildren.Length();
|
||||
}
|
||||
|
@ -2688,16 +2675,16 @@ nsAccessible::IndexInParent() const
|
|||
return mIndexInParent;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsAccessible::GetEmbeddedChildCount()
|
||||
PRUint32
|
||||
nsAccessible::EmbeddedChildCount()
|
||||
{
|
||||
if (IsChildrenFlag(eMixedChildren)) {
|
||||
if (!mEmbeddedObjCollector)
|
||||
mEmbeddedObjCollector = new EmbeddedObjCollector(this);
|
||||
return mEmbeddedObjCollector ? mEmbeddedObjCollector->Count() : -1;
|
||||
return mEmbeddedObjCollector->Count();
|
||||
}
|
||||
|
||||
return GetChildCount();
|
||||
return ChildCount();
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
|
@ -3074,7 +3061,8 @@ nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
if (aError && mIndexInParent + aOffset >= mParent->GetChildCount()) {
|
||||
if (aError &&
|
||||
mIndexInParent + aOffset >= static_cast<PRInt32>(mParent->ChildCount())) {
|
||||
*aError = NS_OK; // fail peacefully
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -3249,8 +3237,8 @@ nsAccessible::GetLevelInternal()
|
|||
// If this listitem is on top of nested lists then expose 'level'
|
||||
// attribute.
|
||||
parent = Parent();
|
||||
PRInt32 siblingCount = parent->GetChildCount();
|
||||
for (PRInt32 siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
|
||||
PRUint32 siblingCount = parent->ChildCount();
|
||||
for (PRUint32 siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
|
||||
nsAccessible* sibling = parent->GetChildAt(siblingIdx);
|
||||
|
||||
nsAccessible* siblingChild = sibling->LastChild();
|
||||
|
|
|
@ -328,7 +328,7 @@ public:
|
|||
/**
|
||||
* Return child accessible count.
|
||||
*/
|
||||
virtual PRInt32 GetChildCount();
|
||||
virtual PRUint32 ChildCount() const;
|
||||
|
||||
/**
|
||||
* Return index of the given child accessible.
|
||||
|
@ -353,10 +353,10 @@ public:
|
|||
inline nsAccessible* PrevSibling() const
|
||||
{ return GetSiblingAtOffset(-1); }
|
||||
inline nsAccessible* FirstChild()
|
||||
{ return GetChildCount() != 0 ? GetChildAt(0) : nsnull; }
|
||||
{ return GetChildAt(0); }
|
||||
inline nsAccessible* LastChild()
|
||||
{
|
||||
PRUint32 childCount = GetChildCount();
|
||||
PRUint32 childCount = ChildCount();
|
||||
return childCount != 0 ? GetChildAt(childCount - 1) : nsnull;
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ public:
|
|||
/**
|
||||
* Return embedded accessible children count.
|
||||
*/
|
||||
PRInt32 GetEmbeddedChildCount();
|
||||
PRUint32 EmbeddedChildCount();
|
||||
|
||||
/**
|
||||
* Return embedded accessible child at the given index.
|
||||
|
|
|
@ -175,9 +175,9 @@ nsTextEquivUtils::AppendFromAccessibleChildren(nsAccessible *aAccessible,
|
|||
{
|
||||
nsresult rv = NS_OK_NO_NAME_CLAUSE_HANDLED;
|
||||
|
||||
PRInt32 childCount = aAccessible->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = aAccessible->GetChildAt(childIdx);
|
||||
PRUint32 childCount = aAccessible->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = aAccessible->GetChildAt(childIdx);
|
||||
rv = AppendFromAccessible(child, aString);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
|
|
@ -1040,9 +1040,9 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
|
|||
return NS_OK;
|
||||
|
||||
PRInt32 colIdx = 0, colCount = 0;
|
||||
PRInt32 childCount = thisRow->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = thisRow->GetChildAt(childIdx);
|
||||
PRUint32 childCount = thisRow->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = thisRow->GetChildAt(childIdx);
|
||||
if (child == this)
|
||||
colIdx = colCount;
|
||||
|
||||
|
@ -1061,9 +1061,9 @@ ARIAGridCellAccessible::GetAttributesInternal(nsIPersistentProperties* aAttribut
|
|||
return NS_OK;
|
||||
|
||||
PRInt32 rowIdx = 0;
|
||||
childCount = table->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = table->GetChildAt(childIdx);
|
||||
childCount = table->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = table->GetChildAt(childIdx);
|
||||
if (child == thisRow)
|
||||
break;
|
||||
|
||||
|
|
|
@ -589,8 +589,8 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
|
|||
if (!popupContainer)
|
||||
return;
|
||||
|
||||
PRInt32 childCount = popupContainer->GetChildCount();
|
||||
for (PRInt32 idx = 0; idx < childCount; idx++) {
|
||||
PRUint32 childCount = popupContainer->ChildCount();
|
||||
for (PRUint32 idx = 0; idx < childCount; idx++) {
|
||||
nsAccessible* child = popupContainer->GetChildAt(idx);
|
||||
if (child->IsAutoCompletePopup()) {
|
||||
popup = child;
|
||||
|
|
|
@ -51,7 +51,7 @@ nsHTMLImageMapAccessible::NativeRole()
|
|||
PRUint32
|
||||
nsHTMLImageMapAccessible::AnchorCount()
|
||||
{
|
||||
return GetChildCount();
|
||||
return ChildCount();
|
||||
}
|
||||
|
||||
nsAccessible*
|
||||
|
|
|
@ -112,7 +112,7 @@ nsHTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttri
|
|||
// Pick up object attribute from abbr DOM element (a child of the cell) or
|
||||
// from abbr DOM attribute.
|
||||
nsAutoString abbrText;
|
||||
if (GetChildCount() == 1) {
|
||||
if (ChildCount() == 1) {
|
||||
nsAccessible* abbr = FirstChild();
|
||||
if (abbr->IsAbbreviation()) {
|
||||
nsTextEquivUtils::
|
||||
|
@ -1397,7 +1397,7 @@ nsHTMLTableAccessible::IsProbablyLayoutTable()
|
|||
}
|
||||
|
||||
nsAccessible* cell = mDoc->GetAccessible(cellElm);
|
||||
if (cell && cell->GetChildCount() == 1 &&
|
||||
if (cell && cell->ChildCount() == 1 &&
|
||||
cell->FirstChild()->IsAbbreviation()) {
|
||||
RETURN_LAYOUT_ANSWER(false,
|
||||
"has abbr -- legitimate table structures");
|
||||
|
@ -1454,7 +1454,7 @@ nsHTMLTableAccessible::IsProbablyLayoutTable()
|
|||
|
||||
// Check for styled background color across rows (alternating background
|
||||
// color is a common feature for data tables).
|
||||
PRUint32 childCount = GetChildCount();
|
||||
PRUint32 childCount = ChildCount();
|
||||
nscolor rowColor, prevRowColor;
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = GetChildAt(childIdx);
|
||||
|
|
|
@ -140,7 +140,7 @@ nsHyperTextAccessible::NativeState()
|
|||
states |= states::READONLY;
|
||||
}
|
||||
|
||||
if (GetChildCount() > 0)
|
||||
if (HasChildren())
|
||||
states |= states::SELECTABLE_TEXT;
|
||||
|
||||
return states;
|
||||
|
@ -271,8 +271,8 @@ nsHyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
|
|||
|
||||
// Loop through children and collect valid offsets, text and bounds
|
||||
// depending on what we need for out parameters.
|
||||
PRInt32 childCount = GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *childAcc = mChildren[childIdx];
|
||||
lastAccessible = childAcc;
|
||||
|
||||
|
@ -609,9 +609,9 @@ nsHyperTextAccessible::DOMPointToHypertextOffset(nsINode *aNode,
|
|||
// If childAccessible is null we will end up adding up the entire length of
|
||||
// the hypertext, which is good -- it just means our offset node
|
||||
// came after the last accessible child's node
|
||||
PRInt32 childCount = GetChildCount();
|
||||
PRUint32 childCount = ChildCount();
|
||||
|
||||
PRInt32 childIdx = 0;
|
||||
PRUint32 childIdx = 0;
|
||||
nsAccessible *childAcc = nsnull;
|
||||
for (; childIdx < childCount; childIdx++) {
|
||||
childAcc = mChildren[childIdx];
|
||||
|
@ -1290,8 +1290,8 @@ nsHyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
|
|||
// We have an point in an accessible child of this, now we need to add up the
|
||||
// offsets before it to what we already have
|
||||
PRInt32 offset = 0;
|
||||
PRInt32 childCount = GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *childAcc = mChildren[childIdx];
|
||||
|
||||
nsIFrame *primaryFrame = childAcc->GetFrame();
|
||||
|
@ -2195,7 +2195,7 @@ nsHyperTextAccessible::GetChildIndexAtOffset(PRUint32 aOffset)
|
|||
}
|
||||
}
|
||||
|
||||
PRUint32 childCount = GetChildCount();
|
||||
PRUint32 childCount = ChildCount();
|
||||
while (mOffsets.Length() < childCount) {
|
||||
nsAccessible* child = GetChildAt(mOffsets.Length());
|
||||
lastOffset += nsAccUtils::TextLength(child);
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
*/
|
||||
inline PRUint32 GetLinkCount()
|
||||
{
|
||||
return GetEmbeddedChildCount();
|
||||
return EmbeddedChildCount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,7 +181,7 @@ public:
|
|||
*/
|
||||
inline PRUint32 CharacterCount()
|
||||
{
|
||||
return GetChildOffset(GetChildCount());
|
||||
return GetChildOffset(ChildCount());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -233,8 +233,8 @@ nsAccessibleWrap::GetUnignoredChildren(nsTArray<nsAccessible*>* aChildrenArray)
|
|||
if (nsAccUtils::MustPrune(this))
|
||||
return;
|
||||
|
||||
PRInt32 childCount = GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessibleWrap *childAcc =
|
||||
static_cast<nsAccessibleWrap*>(GetChildAt(childIdx));
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ __try {
|
|||
if (nsAccUtils::MustPrune(this))
|
||||
return S_OK;
|
||||
|
||||
*pcountChildren = GetChildCount();
|
||||
*pcountChildren = ChildCount();
|
||||
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
|
||||
return S_OK;
|
||||
|
@ -1048,10 +1048,10 @@ __try {
|
|||
|
||||
mEnumVARIANTPosition += aNumElements;
|
||||
|
||||
PRInt32 numChildren = GetChildCount();
|
||||
if (mEnumVARIANTPosition > numChildren)
|
||||
PRUint32 childCount = ChildCount();
|
||||
if (mEnumVARIANTPosition > static_cast<PRInt32>(childCount))
|
||||
{
|
||||
mEnumVARIANTPosition = numChildren;
|
||||
mEnumVARIANTPosition = childCount;
|
||||
return S_FALSE;
|
||||
}
|
||||
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
|
||||
|
|
|
@ -475,8 +475,8 @@ nsXFormsSelectableAccessible::GetItemByIndex(PRUint32* aIndex,
|
|||
nsAccessible* aAccessible)
|
||||
{
|
||||
nsAccessible* accessible = aAccessible ? aAccessible : this;
|
||||
PRInt32 childCount = accessible->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = accessible->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *child = accessible->GetChildAt(childIdx);
|
||||
nsIContent* childContent = child->GetContent();
|
||||
nsINodeInfo *nodeInfo = childContent->NodeInfo();
|
||||
|
|
|
@ -446,8 +446,8 @@ XULGroupboxAccessible::RelationByType(PRUint32 aType)
|
|||
// The label for xul:groupbox is generated from xul:label that is
|
||||
// inside the anonymous content of the xul:caption.
|
||||
// The xul:label has an accessible object but the xul:caption does not
|
||||
PRInt32 childCount = GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible *childAcc = GetChildAt(childIdx);
|
||||
if (childAcc->Role() == roles::LABEL) {
|
||||
// Ensure that it's our label
|
||||
|
@ -601,8 +601,8 @@ XULToolbarButtonAccessible::GetPositionAndSizeInternal(PRInt32* aPosInSet,
|
|||
if (!parent)
|
||||
return;
|
||||
|
||||
PRInt32 childCount = parent->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
PRUint32 childCount = parent->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
nsAccessible* child = parent->GetChildAt(childIdx);
|
||||
if (IsSeparator(child)) { // end of a group of buttons
|
||||
if (posInSet)
|
||||
|
|
|
@ -528,9 +528,9 @@ nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
|
|||
nsAccessible *item = mDoc->GetAccessible(itemContent);
|
||||
|
||||
if (item) {
|
||||
PRInt32 cellCount = item->GetChildCount();
|
||||
for (PRInt32 cellIdx = 0; cellIdx < cellCount; cellIdx++) {
|
||||
nsAccessible *cell = mChildren[cellIdx];
|
||||
PRUint32 cellCount = item->ChildCount();
|
||||
for (PRUint32 cellIdx = 0; cellIdx < cellCount; cellIdx++) {
|
||||
nsAccessible* cell = mChildren[cellIdx];
|
||||
if (cell->Role() == roles::CELL)
|
||||
selCells->AppendElement(static_cast<nsIAccessible*>(cell), false);
|
||||
}
|
||||
|
@ -1080,8 +1080,8 @@ nsXULListCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
|
|||
nsAccessible *list = nsnull;
|
||||
|
||||
nsRefPtr<nsAccessible> tableAcc(do_QueryObject(table));
|
||||
PRInt32 tableChildCount = tableAcc->GetChildCount();
|
||||
for (PRInt32 childIdx = 0; childIdx < tableChildCount; childIdx++) {
|
||||
PRUint32 tableChildCount = tableAcc->ChildCount();
|
||||
for (PRUint32 childIdx = 0; childIdx < tableChildCount; childIdx++) {
|
||||
nsAccessible *child = tableAcc->GetChildAt(childIdx);
|
||||
if (child->Role() == roles::LIST) {
|
||||
list = child;
|
||||
|
|
|
@ -428,22 +428,19 @@ nsXULTreeAccessible::SelectAll()
|
|||
nsAccessible*
|
||||
nsXULTreeAccessible::GetChildAt(PRUint32 aIndex)
|
||||
{
|
||||
PRInt32 childCount = nsAccessible::GetChildCount();
|
||||
if (childCount == -1)
|
||||
return nsnull;
|
||||
|
||||
if (static_cast<PRInt32>(aIndex) < childCount)
|
||||
PRUint32 childCount = nsAccessible::ChildCount();
|
||||
if (aIndex < childCount)
|
||||
return nsAccessible::GetChildAt(aIndex);
|
||||
|
||||
return GetTreeItemAccessible(aIndex - childCount);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsXULTreeAccessible::GetChildCount()
|
||||
PRUint32
|
||||
nsXULTreeAccessible::ChildCount() const
|
||||
{
|
||||
// tree's children count is row count + treecols count.
|
||||
PRInt32 childCount = nsAccessible::GetChildCount();
|
||||
if (childCount == -1 || !mTreeView)
|
||||
// Tree's children count is row count + treecols count.
|
||||
PRUint32 childCount = nsAccessible::ChildCount();
|
||||
if (!mTreeView)
|
||||
return childCount;
|
||||
|
||||
PRInt32 rowCount = 0;
|
||||
|
|
|
@ -23,7 +23,6 @@ const PRUint32 kDefaultTreeCacheSize = 256;
|
|||
class nsXULTreeAccessible : public nsAccessibleWrap
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetChildCount;
|
||||
using nsAccessible::GetChildAt;
|
||||
|
||||
nsXULTreeAccessible(nsIContent* aContent, nsDocAccessible* aDoc);
|
||||
|
@ -44,7 +43,7 @@ public:
|
|||
EWhichChildAtPoint aWhichChild);
|
||||
|
||||
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual PRInt32 GetChildCount();
|
||||
virtual PRUint32 ChildCount() const;
|
||||
|
||||
// SelectAccessible
|
||||
virtual bool IsSelect();
|
||||
|
|
|
@ -667,12 +667,9 @@ nsXULTreeGridRowAccessible::GetChildAt(PRUint32 aIndex)
|
|||
return GetCellAccessible(column);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsXULTreeGridRowAccessible::GetChildCount()
|
||||
PRUint32
|
||||
nsXULTreeGridRowAccessible::ChildCount() const
|
||||
{
|
||||
if (IsDefunct())
|
||||
return -1;
|
||||
|
||||
return nsCoreUtils::GetSensibleColumnCount(mTree);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@ protected:
|
|||
class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
|
||||
{
|
||||
public:
|
||||
using nsAccessible::GetChildCount;
|
||||
using nsAccessible::GetChildAt;
|
||||
|
||||
nsXULTreeGridRowAccessible(nsIContent* aContent, nsDocAccessible* aDoc,
|
||||
|
@ -76,7 +75,7 @@ public:
|
|||
EWhichChildAtPoint aWhichChild);
|
||||
|
||||
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
|
||||
virtual PRInt32 GetChildCount();
|
||||
virtual PRUint32 ChildCount() const;
|
||||
|
||||
// nsXULTreeItemAccessibleBase
|
||||
virtual nsAccessible* GetCellAccessible(nsITreeColumn *aColumn);
|
||||
|
|
Загрузка…
Ссылка в новой задаче