From d0308d53dd9f4d036d8c5fe8023920fcdfd43f39 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Feb 2025 02:06:04 +0100 Subject: Remove unnecessary wx_ptr It was only ever used for wxDialog subclasses, which can be stack-allocated. --- src/wx/fonts_dialog.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/wx/fonts_dialog.cc') diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc index dc1bb5951..315f0b369 100644 --- a/src/wx/fonts_dialog.cc +++ b/src/wx/fonts_dialog.cc @@ -184,13 +184,13 @@ FontsDialog::set_from_file_clicked () default_dir = char_to_wx("/System/Library/Fonts"); #endif - auto d = make_wx(this, _("Choose a font file"), default_dir, wxString{}, char_to_wx("*.ttf;*.otf;*.ttc"), wxFD_CHANGE_DIR); + wxFileDialog dialog(this, _("Choose a font file"), default_dir, wxString{}, char_to_wx("*.ttf;*.otf;*.ttc"), wxFD_CHANGE_DIR); - if (d->ShowModal() != wxID_OK) { + if (dialog.ShowModal() != wxID_OK) { return; } - font->set_file (wx_to_std(d->GetPath())); + font->set_file(wx_to_std(dialog.GetPath())); setup (); } @@ -203,9 +203,9 @@ FontsDialog::set_from_system_font_clicked() return; } - auto dialog = make_wx(this); - if (dialog->ShowModal() == wxID_OK) { - auto font_file = dialog->get_font(); + SystemFontDialog dialog(this); + if (dialog.ShowModal() == wxID_OK) { + auto font_file = dialog.get_font(); if (font_file) { font->set_file(*font_file); } -- cgit v1.2.3