diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-11 03:02:49 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-11 13:12:21 +0200 |
| commit | 31194f452231ee1383ae24c2762f0094be09571c (patch) | |
| tree | b5107fcc3425d1d97fb5073a6fa038dafa48acc7 | |
| parent | 6249ca3c3f2a9d6861b272281605cfbd8f0e9ecb (diff) | |
split string_client_data into two versions.
| -rw-r--r-- | src/wx/dcp_panel.cc | 2 | ||||
| -rw-r--r-- | src/wx/general_preferences_page.cc | 2 | ||||
| -rw-r--r-- | src/wx/text_panel.cc | 2 | ||||
| -rw-r--r-- | src/wx/wx_util.cc | 17 | ||||
| -rw-r--r-- | src/wx/wx_util.h | 3 |
5 files changed, 17 insertions, 9 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 398137b1e..8877dbc9c 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -320,7 +320,7 @@ DCPPanel::audio_channels_changed() return; } - _film->set_audio_channels(wxNumberFormatter::FromString(string_client_data(_audio_channels->GetClientObject(*_audio_channels->get())))); + _film->set_audio_channels(wxNumberFormatter::FromString(wx_string_client_data(_audio_channels->GetClientObject(*_audio_channels->get())))); } diff --git a/src/wx/general_preferences_page.cc b/src/wx/general_preferences_page.cc index beed9012f..8489a71b0 100644 --- a/src/wx/general_preferences_page.cc +++ b/src/wx/general_preferences_page.cc @@ -272,7 +272,7 @@ GeneralPage::language_changed() { int const sel = _language->GetSelection(); if (sel != -1) { - Config::instance()->set_language(string_client_data(_language->GetClientObject(sel))); + Config::instance()->set_language(wx_string_client_data(_language->GetClientObject(sel))); } else { Config::instance()->unset_language(); } diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc index 7e4ccf5d7..6c698e383 100644 --- a/src/wx/text_panel.cc +++ b/src/wx/text_panel.cc @@ -604,7 +604,7 @@ TextPanel::stream_changed () auto a = fcs->subtitle_streams (); auto i = a.begin (); - auto const s = string_client_data (_stream->GetClientObject(_stream->GetSelection())); + auto const s = wx_string_client_data(_stream->GetClientObject(_stream->GetSelection())); while (i != a.end() && (*i)->identifier () != s) { ++i; } diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 4aa197345..3f3b742af 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -224,9 +224,16 @@ char_to_wx(char const* s) string -string_client_data (wxClientData* o) +std_string_client_data(wxClientData* o) { - return wx_to_std (dynamic_cast<wxStringClientData*>(o)->GetData()); + return wx_to_std(dynamic_cast<wxStringClientData*>(o)->GetData()); +} + + +wxString +wx_string_client_data(wxClientData* o) +{ + return dynamic_cast<wxStringClientData*>(o)->GetData(); } @@ -296,9 +303,9 @@ checked_set (wxChoice* widget, string value) o = widget->GetClientObject (widget->GetSelection ()); } - if (!o || string_client_data(o) != value) { + if (!o || std_string_client_data(o) != value) { for (unsigned int i = 0; i < widget->GetCount(); ++i) { - if (string_client_data (widget->GetClientObject (i)) == value) { + if (std_string_client_data(widget->GetClientObject(i)) == value) { widget->SetSelection (i); } } @@ -314,7 +321,7 @@ checked_set (wxChoice* widget, vector<pair<string, string>> items) current.push_back ( make_pair( wx_to_std(widget->GetString(i)), - widget->GetClientData() ? string_client_data(widget->GetClientObject(i)) : "" + widget->GetClientData() ? std_string_client_data(widget->GetClientObject(i)) : "" ) ); } diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 2968ce9ff..dff644b00 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -110,7 +110,8 @@ extern wxString char_to_wx(char const* s); extern void dcpomatic_setup_i18n (); extern wxString context_translation(char const* s); -extern std::string string_client_data (wxClientData* o); +extern std::string std_string_client_data(wxClientData* o); +extern wxString wx_string_client_data(wxClientData* o); extern wxString time_to_timecode (dcpomatic::DCPTime t, double fps); extern void setup_audio_channels_choice (wxChoice* choice, int minimum); extern wxSplashScreen* maybe_show_splash(); |
