]> git.saurik.com Git - wxWidgets.git/commitdiff
Commited region iterator fix.
authorRobert Roebling <robert@roebling.de>
Tue, 31 Oct 2006 22:48:38 +0000 (22:48 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 31 Oct 2006 22:48:38 +0000 (22:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/region.h
src/gtk/region.cpp

index 71f47a47aa06c491a8717d16a955c61421cd4e7f..1886952495a9724e20c54b13b7118f4e557eeb86 100644 (file)
@@ -94,8 +94,11 @@ class WXDLLIMPEXP_CORE wxRegionIterator: public wxObject
 public:
     wxRegionIterator();
     wxRegionIterator(const wxRegion& region);
+    wxRegionIterator(const wxRegionIterator& ri) : wxObject(ri) { Init(); *this = ri; }
     ~wxRegionIterator();
 
+    wxRegionIterator& operator=(const wxRegionIterator& ri);
+
     void Reset() { m_current = 0u; }
     void Reset(const wxRegion& region);
 
index 57b6b02ffc0b8df714eda6b46a80b37c2ed26bc3..33ee658dbdb4aee5b07aa4500538265f87dd49b6 100644 (file)
@@ -455,3 +455,23 @@ wxRect wxRegionIterator::GetRect() const
 
     return r;
 }
+
+wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& ri)
+{
+    wxDELETEA(m_rects);
+
+    m_current = ri.m_current;
+    m_numRects = ri.m_numRects;
+    if ( m_numRects )
+    {
+        m_rects = new wxRect[m_numRects];
+        for ( long n = 0; n < m_numRects; n++ )
+            m_rects[n] = ri.m_rects[n];
+    }
+    else
+    {
+        m_rects = NULL;
+    }
+
+    return *this;
+}