don't use EM_STREAMIN at all in Unicode mode, it's not needed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -443,7 +443,7 @@ void wxTextCtrl::SetValue(const wxString& value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_RICHEDIT
|
#if wxUSE_RICHEDIT && !wxUSE_UNICODE
|
||||||
|
|
||||||
DWORD CALLBACK wxRichEditStreamIn(DWORD dwCookie, BYTE *buf, LONG cb, LONG *pcb)
|
DWORD CALLBACK wxRichEditStreamIn(DWORD dwCookie, BYTE *buf, LONG cb, LONG *pcb)
|
||||||
{
|
{
|
||||||
@@ -468,7 +468,6 @@ extern long wxEncodingToCodepage(wxFontEncoding encoding); // from strconv.cpp
|
|||||||
|
|
||||||
bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding)
|
bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding)
|
||||||
{
|
{
|
||||||
#if !wxUSE_UNICODE
|
|
||||||
// we have to use EM_STREAMIN to force richedit control 2.0+ to show any
|
// we have to use EM_STREAMIN to force richedit control 2.0+ to show any
|
||||||
// text in the non default charset - otherwise it thinks it knows better
|
// text in the non default charset - otherwise it thinks it knows better
|
||||||
// than we do and always shows it in the default one
|
// than we do and always shows it in the default one
|
||||||
@@ -492,9 +491,6 @@ bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding)
|
|||||||
|
|
||||||
// finally, stream it in the control
|
// finally, stream it in the control
|
||||||
const wchar_t *wpc = wchBuf;
|
const wchar_t *wpc = wchBuf;
|
||||||
#else
|
|
||||||
const wchar_t *wpc = value.c_str();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EDITSTREAM eds;
|
EDITSTREAM eds;
|
||||||
wxZeroMemory(eds);
|
wxZeroMemory(eds);
|
||||||
@@ -533,6 +529,7 @@ void wxTextCtrl::WriteText(const wxString& value)
|
|||||||
SetStyle(start, end, m_defaultStyle );
|
SetStyle(start, end, m_defaultStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !wxUSE_UNICODE
|
||||||
// next check if the text we're inserting must be shown in a non
|
// next check if the text we're inserting must be shown in a non
|
||||||
// default charset -- this only works for RichEdit > 1.0
|
// default charset -- this only works for RichEdit > 1.0
|
||||||
if ( GetRichVersion() > 1 )
|
if ( GetRichVersion() > 1 )
|
||||||
@@ -550,6 +547,7 @@ void wxTextCtrl::WriteText(const wxString& value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // !wxUSE_UNICODE
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !done )
|
if ( !done )
|
||||||
|
Reference in New Issue
Block a user