From d0060d66357965d45ca6f59130caacc5acf0ff90 Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Tue, 23 Feb 1999 18:49:57 +0000 Subject: [PATCH] Put back the code but this time using the newly defined nsIBidirectionalEnumerator --- widget/src/mac/nsWindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/widget/src/mac/nsWindow.cpp b/widget/src/mac/nsWindow.cpp index 0935d674eaf..fc7a9f60fcd 100644 --- a/widget/src/mac/nsWindow.cpp +++ b/widget/src/mac/nsWindow.cpp @@ -1124,27 +1124,28 @@ nsWindow* nsWindow::FindWidgetHit(Point aThePoint) return nsnull; nsWindow* widgetHit = this; - nsIEnumerator* children = GetChildren(); + + nsIBidirectionalEnumerator* children = static_cast(GetChildren()); if (children) { // traverse through all the nsWindows to find out who got hit, lowest level of course - children->First(); + children->Last(); do { nsISupports* child; if (NS_SUCCEEDED(children->CurrentItem(&child))) { nsWindow* childWindow = static_cast(child); + NS_RELEASE(child); nsWindow* deeperHit = childWindow->FindWidgetHit(aThePoint); if (deeperHit) { widgetHit = deeperHit; break; } - NS_RELEASE(child); } } - while (NS_SUCCEEDED(children->Next())); + while (NS_SUCCEEDED(children->Prev())); NS_RELEASE(children); }