summaryrefslogtreecommitdiff
path: root/src/wx/editable_list.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-02-09 02:06:04 +0100
committerCarl Hetherington <cth@carlh.net>2025-02-09 17:29:16 +0100
commitd0308d53dd9f4d036d8c5fe8023920fcdfd43f39 (patch)
tree5b37c1db5dc50e541a542663390061f743fe815a /src/wx/editable_list.h
parent8d0d9866ae3e0395d899705e27b3806a5de7ef0e (diff)
Remove unnecessary wx_ptr
It was only ever used for wxDialog subclasses, which can be stack-allocated.
Diffstat (limited to 'src/wx/editable_list.h')
-rw-r--r--src/wx/editable_list.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h
index aea15eb90..0cb4c841f 100644
--- a/src/wx/editable_list.h
+++ b/src/wx/editable_list.h
@@ -232,10 +232,10 @@ private:
void add_clicked ()
{
- auto dialog = make_wx<S>(this);
+ S dialog(this);
- if (dialog->ShowModal() == wxID_OK) {
- auto const v = dialog->get ();
+ if (dialog.ShowModal() == wxID_OK) {
+ auto const v = dialog.get();
static_assert(std::is_same<typename std::remove_const<decltype(v)>::type, boost::optional<T>>::value, "get() must return boost::optional<T>");
if (v) {
add_to_control (v.get ());
@@ -256,10 +256,10 @@ private:
std::vector<T> all = _get ();
DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
- auto dialog = make_wx<S>(this);
- dialog->set (all[item]);
- if (dialog->ShowModal() == wxID_OK) {
- auto const v = dialog->get ();
+ S dialog(this);
+ dialog.set(all[item]);
+ if (dialog.ShowModal() == wxID_OK) {
+ auto const v = dialog.get();
static_assert(std::is_same<typename std::remove_const<decltype(v)>::type, boost::optional<T>>::value, "get() must return boost::optional<T>");
if (!v) {
return;