From b8afff01ccdc8b71407caa2c9c09c8196ffbf5e3 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 9 Jan 2009 14:04:03 +0000 Subject: [PATCH] guarding against calls through 'non-window' instances like native file dialog, which on CentreOnParent crash otherwise git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/nonownedwnd_osx.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 59905b824f..d8b9e02ce7 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -350,6 +350,9 @@ bool wxNonOwnedWindow::SetBackgroundStyle(wxBackgroundStyle style) void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height) { + if ( m_nowpeer == NULL ) + return; + m_cachedClippedRectValid = false ; m_nowpeer->MoveWindow(x, y, width, height); @@ -358,6 +361,9 @@ void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height) void wxNonOwnedWindow::DoGetPosition( int *x, int *y ) const { + if ( m_nowpeer == NULL ) + return; + int x1,y1 ; m_nowpeer->GetPosition(x1, y1); @@ -369,6 +375,9 @@ void wxNonOwnedWindow::DoGetPosition( int *x, int *y ) const void wxNonOwnedWindow::DoGetSize( int *width, int *height ) const { + if ( m_nowpeer == NULL ) + return; + int w,h; m_nowpeer->GetSize(w, h); @@ -381,6 +390,9 @@ void wxNonOwnedWindow::DoGetSize( int *width, int *height ) const void wxNonOwnedWindow::DoGetClientSize( int *width, int *height ) const { + if ( m_nowpeer == NULL ) + return; + int left, top, w, h; m_nowpeer->GetContentArea(left, top, w, h); -- 2.47.2