summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-06 17:52:51 +0200
committerCarl Hetherington <cth@carlh.net>2025-05-08 01:29:35 +0200
commit71f9236b03ef8934d28d291f1d9f248137448e72 (patch)
tree3d709612d0f826e841c7dea0aea09775c53bb917
parent05535846f69e16bc659b874bcafd02a8ee9e96e7 (diff)
Return std::string rather than wxString from Choice::get_data().
-rw-r--r--src/wx/dcp_panel.cc8
-rw-r--r--src/wx/dcpomatic_choice.cc5
-rw-r--r--src/wx/dcpomatic_choice.h2
-rw-r--r--src/wx/metadata_dialog.cc5
-rw-r--r--src/wx/text_panel.cc2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 8c5b4ec7e..2341bf043 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -186,19 +186,19 @@ DCPPanel::standard_changed()
return;
}
- if (*data == char_to_wx("interop")) {
+ if (*data == "interop") {
_film->set_interop(true);
_film->set_limit_to_smpte_bv20(false);
_film->set_video_encoding(VideoEncoding::JPEG2000);
- } else if (*data == char_to_wx("smpte")) {
+ } else if (*data == "smpte") {
_film->set_interop(false);
_film->set_limit_to_smpte_bv20(false);
_film->set_video_encoding(VideoEncoding::JPEG2000);
- } else if (*data == char_to_wx("smpte-bv20")) {
+ } else if (*data == "smpte-bv20") {
_film->set_interop(false);
_film->set_limit_to_smpte_bv20(true);
_film->set_video_encoding(VideoEncoding::JPEG2000);
- } else if (*data == char_to_wx("mpeg2-interop")) {
+ } else if (*data == "mpeg2-interop") {
_film->set_interop(true);
_film->set_video_encoding(VideoEncoding::MPEG2);
}
diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc
index c458296f6..5b3b9fb48 100644
--- a/src/wx/dcpomatic_choice.cc
+++ b/src/wx/dcpomatic_choice.cc
@@ -141,15 +141,16 @@ Choice::get() const
}
-optional<wxString>
+optional<string>
Choice::get_data() const
{
+
auto index = get();
if (!index) {
return {};
}
- return dynamic_cast<wxStringClientData*>(GetClientObject(*index))->GetData();
+ return wx_to_std(dynamic_cast<wxStringClientData*>(GetClientObject(*index))->GetData());
}
diff --git a/src/wx/dcpomatic_choice.h b/src/wx/dcpomatic_choice.h
index fde6a8cbb..84ff45fcf 100644
--- a/src/wx/dcpomatic_choice.h
+++ b/src/wx/dcpomatic_choice.h
@@ -46,7 +46,7 @@ public:
void set_by_data(wxString const& data);
void set_by_data(std::string const& data);
boost::optional<int> get() const;
- boost::optional<wxString> get_data() const;
+ boost::optional<std::string> get_data() const;
template <typename... Args>
void bind(Args... args) {
diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc
index 70f6e8c39..22d43a46e 100644
--- a/src/wx/metadata_dialog.cc
+++ b/src/wx/metadata_dialog.cc
@@ -129,9 +129,8 @@ MetadataDialog::setup ()
void
MetadataDialog::territory_type_changed()
{
- auto data = _territory_type->get_data();
- if (data) {
- film()->set_territory_type(string_to_territory_type(wx_to_std(data->data())));
+ if (auto data = _territory_type->get_data()) {
+ film()->set_territory_type(string_to_territory_type(*data));
}
}
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index f2055a542..7e4ccf5d7 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -491,7 +491,7 @@ TextPanel::current_type () const
{
if (_type->size()) {
if (auto type = _type->get_data()) {
- return string_to_text_type(wx_to_std(*type));
+ return string_to_text_type(*type);
}
}