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
This commit is contained in:
Stefan Csomor
2009-01-09 14:04:03 +00:00
parent d2fa18d3a1
commit b8afff01cc

View File

@@ -350,6 +350,9 @@ bool wxNonOwnedWindow::SetBackgroundStyle(wxBackgroundStyle style)
void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height) void wxNonOwnedWindow::DoMoveWindow(int x, int y, int width, int height)
{ {
if ( m_nowpeer == NULL )
return;
m_cachedClippedRectValid = false ; m_cachedClippedRectValid = false ;
m_nowpeer->MoveWindow(x, y, width, height); 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 void wxNonOwnedWindow::DoGetPosition( int *x, int *y ) const
{ {
if ( m_nowpeer == NULL )
return;
int x1,y1 ; int x1,y1 ;
m_nowpeer->GetPosition(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 void wxNonOwnedWindow::DoGetSize( int *width, int *height ) const
{ {
if ( m_nowpeer == NULL )
return;
int w,h; int w,h;
m_nowpeer->GetSize(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 void wxNonOwnedWindow::DoGetClientSize( int *width, int *height ) const
{ {
if ( m_nowpeer == NULL )
return;
int left, top, w, h; int left, top, w, h;
m_nowpeer->GetContentArea(left, top, w, h); m_nowpeer->GetContentArea(left, top, w, h);