PhysicalPrinterDialog: Remove all leading and trailing spaces from "print_host" input

This commit is contained in:
YuSanka 2021-08-03 09:25:54 +02:00
parent 4f1a092ae0
commit 1b49dd9869

View File

@ -434,6 +434,12 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
e.Skip();
temp->GetToolTip()->Enable(true);
#endif // __WXGTK__
// Remove all leading and trailing spaces from the input
std::string trimed_str, str = trimed_str = temp->GetValue().ToStdString();
boost::trim(trimed_str);
if (trimed_str != str)
temp->SetValue(trimed_str);
TextCtrl* field = dynamic_cast<TextCtrl*>(printhost_field);
if (field)
field->propagate_value();