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
|
// we have to loop up through superviews in case the view that received the
|
||||||
// mouseDown is in fact a plugin view with no scrollbars
|
// mouseDown is in fact a plugin view with no scrollbars
|
||||||
while (currView) {
|
while (currView) {
|
||||||
// This is a hack I learned in nsView::GetViewFor(nsIWidget* aWidget)
|
nsIWidget* widget = [currView widget];
|
||||||
// that I'm not sure is kosher. If anyone knows a better way to get
|
if (widget) {
|
||||||
// the view for a widget, I'd love to hear it. --Nathan
|
void* clientData;
|
||||||
|
if (NS_SUCCEEDED(widget->GetClientData(clientData))) {
|
||||||
void* clientData;
|
nsISupports* data = (nsISupports*)clientData;
|
||||||
[currView widget]->GetClientData(clientData);
|
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(data));
|
||||||
|
if (req) {
|
||||||
nsISupports* data = (nsISupports*)clientData;
|
req->GetInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollableView);
|
||||||
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(data));
|
if (scrollableView)
|
||||||
if (req) {
|
break;
|
||||||
req->GetInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollableView);
|
}
|
||||||
if (scrollableView)
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([[currView superview] isMemberOfClass:[ChildView class]])
|
NSView* superview = [currView superview];
|
||||||
currView = (ChildView*)[currView superview];
|
if (superview && [superview isMemberOfClass:[ChildView class]])
|
||||||
|
currView = (ChildView*)superview;
|
||||||
else
|
else
|
||||||
currView = nil;
|
currView = nil;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user