mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 15:51:37 +00:00
Put back the code but this time using the newly defined nsIBidirectionalEnumerator
This commit is contained in:
parent
8a25a4d816
commit
43a2bd99fb
@ -1124,27 +1124,28 @@ nsWindow* nsWindow::FindWidgetHit(Point aThePoint)
|
||||
return nsnull;
|
||||
|
||||
nsWindow* widgetHit = this;
|
||||
nsIEnumerator* children = GetChildren();
|
||||
|
||||
nsIBidirectionalEnumerator* children = static_cast<nsIBidirectionalEnumerator*>(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<nsWindow*>(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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user