Add safety checks to ChildView's getScrollableView. Crash fix. b=493238 r=mstange a=dveditz
git-svn-id: svn://10.0.0.236/trunk@258448 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a1935cc6b9
commit
488a89e02f
@ -2333,23 +2333,23 @@ NSEvent* gLastDragEvent = nil;
|
||||
// we have to loop up through superviews in case the view that received the
|
||||
// mouseDown is in fact a plugin view with no scrollbars
|
||||
while (currView) {
|
||||
// This is a hack I learned in nsView::GetViewFor(nsIWidget* aWidget)
|
||||
// that I'm not sure is kosher. If anyone knows a better way to get
|
||||
// the view for a widget, I'd love to hear it. --Nathan
|
||||
|
||||
void* clientData;
|
||||
[currView widget]->GetClientData(clientData);
|
||||
|
||||
nsISupports* data = (nsISupports*)clientData;
|
||||
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(data));
|
||||
if (req) {
|
||||
req->GetInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollableView);
|
||||
if (scrollableView)
|
||||
break;
|
||||
nsIWidget* widget = [currView widget];
|
||||
if (widget) {
|
||||
void* clientData;
|
||||
if (NS_SUCCEEDED(widget->GetClientData(clientData))) {
|
||||
nsISupports* data = (nsISupports*)clientData;
|
||||
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(data));
|
||||
if (req) {
|
||||
req->GetInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollableView);
|
||||
if (scrollableView)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ([[currView superview] isMemberOfClass:[ChildView class]])
|
||||
currView = (ChildView*)[currView superview];
|
||||
NSView* superview = [currView superview];
|
||||
if (superview && [superview isMemberOfClass:[ChildView class]])
|
||||
currView = (ChildView*)superview;
|
||||
else
|
||||
currView = nil;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user