FIX: fix crash when the preset name has Chinese characters
jira: STUDIO-9096 Change-Id: I8925a9ed5c39c52515a581bd824fa57bd6823164
This commit is contained in:
parent
5980be0fd7
commit
901a3bf666
|
@ -287,19 +287,19 @@ wxString PresetComboBox::get_preset_item_name(unsigned int index)
|
||||||
if (m_type == Preset::TYPE_PRINTER) {
|
if (m_type == Preset::TYPE_PRINTER) {
|
||||||
int idx = selected_connected_printer();
|
int idx = selected_connected_printer();
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
return GetString(index).ToUTF8().data();
|
return GetString(index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
assert(false);
|
assert(false);
|
||||||
return GetString(index).ToUTF8().data();
|
return GetString(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, MachineObject *> machine_list = dev->get_my_machine_list();
|
std::map<std::string, MachineObject *> machine_list = dev->get_my_machine_list();
|
||||||
if (machine_list.empty()) {
|
if (machine_list.empty()) {
|
||||||
assert(false);
|
assert(false);
|
||||||
return GetString(index).ToUTF8().data();
|
return GetString(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto iter = machine_list.begin();
|
auto iter = machine_list.begin();
|
||||||
|
@ -311,7 +311,7 @@ wxString PresetComboBox::get_preset_item_name(unsigned int index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetString(index).ToUTF8().data();
|
return GetString(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString PresetComboBox::get_preset_name(const Preset & preset)
|
wxString PresetComboBox::get_preset_name(const Preset & preset)
|
||||||
|
|
Loading…
Reference in New Issue