Fix wxRegion::Offset() copy on write behaviour in wxMSW.

Offset the correct, new and unshared, region handle instead of the old and
possibly shared one.

Closes #15690.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-11-20 12:01:03 +00:00
parent 4db1aac9cf
commit c2a9b451ba
2 changed files with 3 additions and 3 deletions

View File

@@ -593,6 +593,7 @@ wxMSW:
- Fix blank wxBitmapComboBox dropdown appearance. - Fix blank wxBitmapComboBox dropdown appearance.
- Make "%lu" work with size_t arguments under Win64 (laro). - Make "%lu" work with size_t arguments under Win64 (laro).
- Fix wxRegion::Offset() with shared objects (Joost Nieuwenhuijse).
3.0.0: (released 2013-11-11) 3.0.0: (released 2013-11-11)

View File

@@ -164,8 +164,7 @@ void wxRegion::Clear()
bool wxRegion::DoOffset(wxCoord x, wxCoord y) bool wxRegion::DoOffset(wxCoord x, wxCoord y)
{ {
const HRGN hrgn = GetHrgn(); wxCHECK_MSG( GetHrgn(), false, wxT("invalid wxRegion") );
wxCHECK_MSG( hrgn, false, wxT("invalid wxRegion") );
if ( !x && !y ) if ( !x && !y )
{ {
@@ -175,7 +174,7 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y)
AllocExclusive(); AllocExclusive();
if ( ::OffsetRgn(hrgn, x, y) == ERROR ) if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
{ {
wxLogLastError(wxT("OffsetRgn")); wxLogLastError(wxT("OffsetRgn"));