File history (recent opened files): fix incorrect behavior when a filename

contains non ascii8 code (utf16 value)
This commit is contained in:
jean-pierre charras 2020-08-05 15:48:03 +02:00
parent ff3d5f0de6
commit a8028e57ee
1 changed files with 4 additions and 2 deletions

View File

@ -49,7 +49,9 @@ void FILE_HISTORY::Load( const APP_SETTINGS_BASE& aSettings )
// file_history stores the most recent file first
for( auto it = aSettings.m_System.file_history.rbegin();
it != aSettings.m_System.file_history.rend(); ++it )
{
AddFileToHistory( *it );
}
}
@ -66,8 +68,8 @@ void FILE_HISTORY::Save( APP_SETTINGS_BASE& aSettings )
{
aSettings.m_System.file_history.clear();
for( const auto& file : m_fileHistory )
aSettings.m_System.file_history.emplace_back( file.ToStdString() );
for( const wxString& filename : m_fileHistory )
aSettings.m_System.file_history.emplace_back( filename );
}