зеркало из https://github.com/mozilla/gecko-dev.git
Bug 807713 - add operator[] for nsTObserverArray. r=bsmedberg
This commit is contained in:
Родитель
433987a803
Коммит
2b4ddeae6f
|
@ -59,9 +59,9 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsAccessiblePivot)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsAccessiblePivot)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsAccessiblePivot)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRoot, nsIAccessible)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRoot, nsIAccessible)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mPosition, nsIAccessible)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mPosition, nsIAccessible)
|
||||||
uint32_t i, length = tmp->mObservers.Length(); \
|
uint32_t i, length = tmp->mObservers.Length();
|
||||||
for (i = 0; i < length; ++i) {
|
for (i = 0; i < length; ++i) {
|
||||||
cb.NoteXPCOMChild(tmp->mObservers.ElementAt(i).get());
|
cb.NoteXPCOMChild(tmp->mObservers[i]);
|
||||||
}
|
}
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,16 @@ class nsAutoTObserverArray : protected nsTObserverArray_base {
|
||||||
return mArray.SafeElementAt(i, def);
|
return mArray.SafeElementAt(i, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shorthand for ElementAt(i)
|
||||||
|
elem_type& operator[](index_type i) {
|
||||||
|
return ElementAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shorthand for ElementAt(i)
|
||||||
|
const elem_type& operator[](index_type i) const {
|
||||||
|
return ElementAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Search methods
|
// Search methods
|
||||||
//
|
//
|
||||||
|
|
Загрузка…
Ссылка в новой задаче