Fix Serializer crashing if a project contains non ASCII characters

This commit is contained in:
Victor Levasseur
2015-07-06 22:29:00 +02:00
parent 6e4f7e67a4
commit 92ff667e7f
10 changed files with 52 additions and 86 deletions
+3 -4
View File
@@ -132,7 +132,7 @@ mainFrameWrapper(mainFrameWrapper_)
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&TextObjectEditor::OnokBtClick);
//*)
textEdit->ChangeValue(gd::utf8::ToWxString(object.GetString()));
textEdit->ChangeValue(object.GetString());
fontEdit->ChangeValue(object.GetFontFilename());
sizeEdit->SetValue(object.GetCharacterSize());
colorBt->SetBackgroundColour(wxColour(object.GetColorR(), object.GetColorG(), object.GetColorB()));
@@ -162,7 +162,7 @@ void TextObjectEditor::AdaptFontColor(wxButton *button)
void TextObjectEditor::OnokBtClick(wxCommandEvent& event)
{
object.SetString(gd::utf8::FromWxString(textEdit->GetValue()));
object.SetString(textEdit->GetValue());
object.SetCharacterSize(sizeEdit->GetValue());
object.SetSmooth(smoothCheck->GetValue());
object.SetColor(static_cast<int>(colorBt->GetBackgroundColour().Red()),
@@ -172,7 +172,7 @@ void TextObjectEditor::OnokBtClick(wxCommandEvent& event)
object.SetBold(boldToggleButton->GetValue());
object.SetItalic(italicToggleButton->GetValue());
object.SetUnderlined(underlineToggleButton->GetValue());
object.SetFontFilename(std::string(fontEdit->GetValue().mb_str()));
object.SetFontFilename(fontEdit->GetValue());
EndModal(1);
}
@@ -205,4 +205,3 @@ void TextObjectEditor::OnSizeEditChange(wxSpinEvent& event)
{
}
#endif