KDM AnnotationText tags are optional.
[dcpomatic.git] / src / tools / dcpomatic_kdm.cc
index 2613358e581a159747c653f48d7fc11d2cdde15e..1f61aad5139c918a12dc00013394b7c78bf679d2 100644 (file)
@@ -86,7 +86,7 @@ class DOMFrame : public wxFrame
 {
 public:
        DOMFrame (wxString const & title)
-               : wxFrame (NULL, -1, title)
+               : wxFrame (0, -1, title)
                , _config_dialog (0)
                , _job_view (0)
        {
@@ -160,7 +160,7 @@ public:
                _create = new wxButton (overall_panel, wxID_ANY, _("Create KDMs"));
                vertical->Add (_create, 0, wxALL, DCPOMATIC_SIZER_GAP);
 
-               main_sizer->Add (vertical, 1, wxALL, DCPOMATIC_DIALOG_BORDER);
+               main_sizer->Add (vertical, 1, wxALL | wxEXPAND, DCPOMATIC_DIALOG_BORDER);
                overall_panel->SetSizer (main_sizer);
 
                /* Instantly save any config changes when using a DCP-o-matic GUI */
@@ -273,7 +273,7 @@ private:
                                dcp::DecryptedKDM kdm (
                                        dcp::LocalTime (_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()),
                                        dcp::LocalTime (_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()),
-                                       decrypted.annotation_text(),
+                                       decrypted.annotation_text().get_value_or (""),
                                        decrypted.content_title_text(),
                                        dcp::LocalTime().as_string()
                                        );
@@ -296,7 +296,7 @@ private:
                                        wxString::Format (s, int(screen_kdms.size()), std_to_wx(_output->directory().string()).data())
                                        );
                        } else {
-                               string film_name = decrypted.annotation_text ();
+                               string film_name = decrypted.annotation_text().get_value_or ("");
                                if (film_name.empty ()) {
                                        film_name = decrypted.content_title_text ();
                                }