From 44dcb12f9103641796d55fbcbdc5e46bb2e3063c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 4 Sep 2006 15:17:22 +0000 Subject: [PATCH] fixed wxRegion::operator== git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40997 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/dfb/region.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dfb/region.cpp b/src/dfb/region.cpp index e2788df22e..bd6e379973 100644 --- a/src/dfb/region.cpp +++ b/src/dfb/region.cpp @@ -33,6 +33,8 @@ public: ~wxRegionRefData() {} + // default assignment and comparision operators are OK + wxRect m_rect; }; @@ -80,11 +82,14 @@ wxRegion::~wxRegion() bool wxRegion::operator==(const wxRegion& region) const { - if ( m_refData != region.m_refData ) - return false; + if ( m_refData == region.m_refData ) + return true; if ( !Ok() ) - return true; // both invalid + { + // only equal if both are invalid, otherwise different + return !region.Ok(); + } return M_REGION->m_rect == M_REGION_OF(region)->m_rect; }