diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-02-25 22:09:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-02-25 22:09:47 +0100 |
| commit | 9b980858ef57ca7ff712e3090b5ec94f49964230 (patch) | |
| tree | c259b6b2e126c4c2c377d3e34ce03425153fced1 /src/wx/name_format_editor.cc | |
| parent | 3737f03c6d8b54afad9d0564389caa9b26e1c30d (diff) | |
Fix failure to use name format with the short output panel (#2646).v2.18.12
Because we would do nothing when there are no _examples.
Diffstat (limited to 'src/wx/name_format_editor.cc')
| -rw-r--r-- | src/wx/name_format_editor.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/wx/name_format_editor.cc b/src/wx/name_format_editor.cc index 166b0e145..ce0760486 100644 --- a/src/wx/name_format_editor.cc +++ b/src/wx/name_format_editor.cc @@ -73,20 +73,18 @@ NameFormatEditor::changed () void NameFormatEditor::update_example () { - if (_examples.empty ()) { - return; - } - _name.set_specification(wx_to_std(_specification->GetValue())); - auto example = wxString::Format(_("e.g. %s"), std_to_wx(careful_string_filter(_name.get(_examples, _suffix)))); - wxString wrapped; - for (size_t i = 0; i < example.Length(); ++i) { - if (i > 0 && (i % 40) == 0) { - wrapped += char_to_wx("\n"); + if (!_examples.empty()) { + auto example = wxString::Format(_("e.g. %s"), std_to_wx(careful_string_filter(_name.get(_examples, _suffix)))); + wxString wrapped; + for (size_t i = 0; i < example.Length(); ++i) { + if (i > 0 && (i % 40) == 0) { + wrapped += char_to_wx("\n"); + } + wrapped += example[i]; } - wrapped += example[i]; - } - _example->SetLabel (wrapped); + _example->SetLabel(wrapped); + } } |
