fixed crash in wxRegion::Empty
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,8 +26,8 @@
|
|||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxRegionRefData implementation
|
// wxRegionRefData implementation
|
||||||
@@ -197,14 +197,17 @@ bool wxRegion::Combine(const wxRect& rect, wxRegionOp op)
|
|||||||
// Outer bounds of region
|
// Outer bounds of region
|
||||||
void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const
|
void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const
|
||||||
{
|
{
|
||||||
if (m_refData) {
|
if (m_refData)
|
||||||
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
::GetRgnBox(M_REGION, & rect);
|
::GetRgnBox(M_REGION, & rect);
|
||||||
x = rect.left;
|
x = rect.left;
|
||||||
y = rect.top;
|
y = rect.top;
|
||||||
w = rect.right - rect.left;
|
w = rect.right - rect.left;
|
||||||
h = rect.bottom - rect.top;
|
h = rect.bottom - rect.top;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
x = y = w = h = 0;
|
x = y = w = h = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,12 +222,10 @@ wxRect wxRegion::GetBox() const
|
|||||||
// Is region empty?
|
// Is region empty?
|
||||||
bool wxRegion::Empty() const
|
bool wxRegion::Empty() const
|
||||||
{
|
{
|
||||||
if (M_REGION == 0)
|
|
||||||
return TRUE;
|
|
||||||
wxCoord x, y, w, h;
|
wxCoord x, y, w, h;
|
||||||
GetBox(x, y, w, h);
|
GetBox(x, y, w, h);
|
||||||
|
|
||||||
return ((w == 0) && (h == 0));
|
return (w == 0) && (h == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user