Fix wxHTTP::SetPostBuffer() compilation in ANSI build.
wxString::mb_str() returns a raw pointer and not wxScopedCharBuffer when wxUSE_UNICODE==0 so fix the code to do it differently in this case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -218,12 +218,20 @@ wxHTTP::SetPostText(const wxString& contentType,
|
|||||||
const wxString& data,
|
const wxString& data,
|
||||||
const wxMBConv& conv)
|
const wxMBConv& conv)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_UNICODE
|
||||||
wxScopedCharBuffer scb = data.mb_str(conv);
|
wxScopedCharBuffer scb = data.mb_str(conv);
|
||||||
if ( !scb.length() )
|
const size_t len = scb.length();
|
||||||
|
const char* const buf = scb.data();
|
||||||
|
#else // !wxUSE_UNICODE
|
||||||
|
const size_t len = data.length();
|
||||||
|
const char* const buf = data.mb_str(conv);
|
||||||
|
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
|
||||||
|
|
||||||
|
if ( !len )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_postBuffer.Clear();
|
m_postBuffer.Clear();
|
||||||
m_postBuffer.AppendData(scb.data(), scb.length());
|
m_postBuffer.AppendData(buf, len);
|
||||||
m_contentType = contentType;
|
m_contentType = contentType;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user