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:
Robert Roebling
2002-08-19 17:02:10 +00:00
parent 127328cdd3
commit ca11abde11
9 changed files with 76 additions and 83 deletions

View File

@@ -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;
}