Lots more Unicode fixes.
wxClipboard fixes for GTK2 and UTF8. wxFileConfig now uses wxConvLocal to convert text and doesn't crash anymore.. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -901,14 +901,24 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
|
||||
|
||||
wxTempFile file(m_strLocalFile);
|
||||
|
||||
if ( !file.IsOpened() ) {
|
||||
if ( !file.IsOpened() )
|
||||
{
|
||||
wxLogError(_("can't open user configuration file."));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// write all strings to file
|
||||
for ( wxFileConfigLineList *p = m_linesHead; p != NULL; p = p->Next() ) {
|
||||
if ( !file.Write(p->Text() + wxTextFile::GetEOL()) ) {
|
||||
for ( wxFileConfigLineList *p = m_linesHead; p != NULL; p = p->Next() )
|
||||
{
|
||||
wxString line = p->Text();
|
||||
line += wxTextFile::GetEOL();
|
||||
#if wxUSE_UNICODE
|
||||
wxCharBuffer buf = wxConvLocal.cWX2MB( line );
|
||||
if ( !file.Write( (const char*)buf, strlen( (const char*) buf ) ) )
|
||||
#else
|
||||
if ( !file.Write( line.c_str(), line.Len() ) )
|
||||
#endif
|
||||
{
|
||||
wxLogError(_("can't write user configuration file."));
|
||||
return FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user