From: Stefan Neis Date: Sun, 2 May 2004 16:48:22 +0000 (+0000) Subject: Don't choke on NULL pointer passed into wxSlider::GetSize. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2da36bfe5aec9685d5b261b1dd2199fa3f73b1ba Don't choke on NULL pointer passed into wxSlider::GetSize. Take the inverted coordinate system into account when computing size. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/os2/slider.cpp b/src/os2/slider.cpp index 7662c87bfb..db9beff768 100644 --- a/src/os2/slider.cpp +++ b/src/os2/slider.cpp @@ -862,8 +862,10 @@ void wxSlider::GetSize( wxFindMaxSize( m_hStaticValue ,&vRect ); - *pnWidth = vRect.xRight - vRect.xLeft; - *pnHeight = vRect.yBottom - vRect.yTop; + if (pnWidth) + *pnWidth = vRect.xRight - vRect.xLeft; + if (pnHeight) + *pnHeight = vRect.yTop - vRect.yBottom; } // end of wxSlider::GetSize int wxSlider::GetThumbLength() const