зеркало из https://github.com/mozilla/gecko-dev.git
Bug 766344 - Fix some casts in nsChildView.mm r=josh
This commit is contained in:
Родитель
c66366d1bd
Коммит
3751c6a8a1
|
@ -304,20 +304,20 @@ nsresult nsChildView::Create(nsIWidget *aParent,
|
|||
// inherit the top-level window. NS_NATIVE_WIDGET is always a NSView
|
||||
// regardless of if we're asking a window or a view (for compatibility
|
||||
// with windows).
|
||||
mParentView = (NSView*)aParent->GetNativeData(NS_NATIVE_WIDGET);
|
||||
mParentView = (NSView<mozView>*)aParent->GetNativeData(NS_NATIVE_WIDGET);
|
||||
mParentWidget = aParent;
|
||||
} else {
|
||||
// This is the normal case. When we're the root widget of the view hiararchy,
|
||||
// aNativeParent will be the contentView of our window, since that's what
|
||||
// nsCocoaWindow returns when asked for an NS_NATIVE_VIEW.
|
||||
mParentView = reinterpret_cast<NSView*>(aNativeParent);
|
||||
mParentView = reinterpret_cast<NSView<mozView>*>(aNativeParent);
|
||||
}
|
||||
|
||||
// create our parallel NSView and hook it up to our parent. Recall
|
||||
// that NS_NATIVE_WIDGET is the NSView.
|
||||
NSRect r;
|
||||
nsCocoaUtils::GeckoRectToNSRect(mBounds, r);
|
||||
mView = [CreateCocoaView(r) retain];
|
||||
mView = [(NSView<mozView>*)CreateCocoaView(r) retain];
|
||||
if (!mView) return NS_ERROR_FAILURE;
|
||||
|
||||
[(ChildView*)mView setIsPluginView:(mWindowType == eWindowType_plugin)];
|
||||
|
@ -709,7 +709,7 @@ nsChildView::ReparentNativeWidget(nsIWidget* aNewParent)
|
|||
return NS_OK;
|
||||
|
||||
NSView<mozView>* newParentView =
|
||||
(NSView*)aNewParent->GetNativeData(NS_NATIVE_WIDGET);
|
||||
(NSView<mozView>*)aNewParent->GetNativeData(NS_NATIVE_WIDGET);
|
||||
NS_ENSURE_TRUE(newParentView, NS_ERROR_FAILURE);
|
||||
|
||||
// we hold a ref to mView, so this is safe
|
||||
|
|
Загрузка…
Ссылка в новой задаче