Cleanup: whitespace / coding style.
[dcpomatic.git] / src / wx / language_tag_dialog.cc
index 6fdcdba7898f039d177bce0aa104439d94e9528f..b472edab07d1a5fda88d417129b23189ebe5b833 100644 (file)
@@ -46,7 +46,7 @@ LanguageTagDialog::LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag)
        overall_sizer->Add (_list, 0, wxALL, DCPOMATIC_SIZER_GAP);
        overall_sizer->Add (add, 0, wxALL, DCPOMATIC_SIZER_GAP);
 
-       auto buttons = CreateSeparatedButtonSizer (wxOK);
+       auto buttons = CreateSeparatedButtonSizer(wxOK | wxCANCEL);
        if (buttons) {
                overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
        }
@@ -75,13 +75,11 @@ LanguageTagDialog::LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag)
 void
 LanguageTagDialog::add_language ()
 {
-       auto full = new FullLanguageTagDialog (GetParent());
-       auto r = full->ShowModal ();
-       if (r == wxID_OK) {
-               Config::instance()->add_custom_language (full->get());
-               set (full->get());
+       FullLanguageTagDialog full(GetParent());
+       if (full.ShowModal() == wxID_OK) {
+               Config::instance()->add_custom_language(full.get());
+               set(full.get());
        }
-       full->Destroy ();
 }