- // Don't change shared data
- if (!m_refData) {
- m_refData = new wxRegionRefData();
- } else if (m_refData->GetRefCount() > 1) {
- wxRegionRefData* ref = (wxRegionRefData*)m_refData;
- UnRef();
- m_refData = new wxRegionRefData(*ref);
- }
- // If ref count is 1, that means it's 'ours' anyway so no action.
+ if ( !x && !y )
+ {
+ // nothing to do
+ return TRUE;
+ }
+
+ AllocExclusive();
+
+ if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
+ {
+ wxLogLastError(_T("OffsetRgn"));
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+// Combine rectangle (x, y, w, h) with this.
+bool wxRegion::Combine(wxCoord x, wxCoord y, wxCoord width, wxCoord height, wxRegionOp op)
+{
+ AllocExclusive();