mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
fixing tests to use the enumerator correctly
This commit is contained in:
parent
43d3cd4a56
commit
ab27bd9d39
@ -106,11 +106,10 @@ nsEventStatus PR_CALLBACK HandleEventMain(nsGUIEvent *aEvent)
|
||||
{
|
||||
nsIEnumerator *enumer = aEvent->widget->GetChildren();
|
||||
if (enumer) {
|
||||
nsISupports *next;
|
||||
next = enumer->Next();
|
||||
if (next) {
|
||||
nsISupports *child;
|
||||
if (NS_SUCCEEDED(enumer->CurrentItem(&child))) {
|
||||
nsIWidget *widget;
|
||||
if (NS_OK == next->QueryInterface(kIWidgetIID, (void**)&widget)) {
|
||||
if (NS_OK == child->QueryInterface(kIWidgetIID, (void**)&widget)) {
|
||||
widget->Resize(0, 0, 200,
|
||||
((nsSizeEvent*)aEvent)->windowSize->height, PR_TRUE);
|
||||
NS_RELEASE(widget);
|
||||
|
@ -832,15 +832,18 @@ void DumpRects()
|
||||
// print all children's position
|
||||
nsIEnumerator *enumerator = window->GetChildren();
|
||||
nsISupports * widget;
|
||||
while (widget = enumerator->Next()) {
|
||||
nsIWidget *child;
|
||||
if (NS_OK == widget->QueryInterface(kIWidgetIID, (void**)&child)) {
|
||||
//
|
||||
child->GetBounds(rect);
|
||||
printf("Bounds(%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height);
|
||||
NS_RELEASE(child);
|
||||
}
|
||||
NS_RELEASE(widget);
|
||||
if (NS_SUCCEEDED(enumerator->CurrentItem(&widget))) {
|
||||
do {
|
||||
nsIWidget *child;
|
||||
if (NS_OK == widget->QueryInterface(kIWidgetIID, (void**)&child)) {
|
||||
//
|
||||
child->GetBounds(rect);
|
||||
printf("Bounds(%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height);
|
||||
NS_RELEASE(child);
|
||||
}
|
||||
NS_RELEASE(widget);
|
||||
}
|
||||
while (enumerator->Next());
|
||||
}
|
||||
|
||||
NS_RELEASE(enumerator);
|
||||
|
Loading…
Reference in New Issue
Block a user