Fix crash when copying Unicode URLs to the clipboard.

Closes #11014.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-23 15:01:32 +00:00
parent a30d58b54d
commit 100d32a6a3
2 changed files with 7 additions and 2 deletions

View File

@@ -121,6 +121,7 @@ All (GUI):
wxMSW:
- Fixed crash when copying Unicode URLs to the clipboard (Tim Kosse).
- Fixed generation of wxEVT_CHAR_HOOK events.
- Implement wxFileName::SetTimes() for directories (Steve Lamerton).
- Correct wxTopLevelWindow::SetShape() for windows with menu bar (Peter Friis).

View File

@@ -1264,8 +1264,12 @@ void wxURLDataObject::SetURL(const wxString& url)
// CFSTR_SHELLURL is always supposed to be ANSI...
wxWX2MBbuf urlA = (wxWX2MBbuf)url.mbc_str();
size_t len = strlen(urlA);
SetData(wxDataFormat(CFSTR_SHELLURL), len+1, (const char*)urlA);
if ( url )
{
size_t len = strlen(urlA);
SetData(wxDataFormat(CFSTR_SHELLURL), len+1, (const char*)urlA);
}
//else: we can't represent this URL in the current code page
}
// ----------------------------------------------------------------------------