No-op: remove all trailing whitespace.
[dcpomatic.git] / src / lib / cinema.cc
index c8cb7b66cc935be866e8049b3a489971fd2712bc..f774392386b7136568b2dbe06e16b1f6e50f7654 100644 (file)
@@ -17,9 +17,9 @@
 
 */
 
-#include <libxml++/libxml++.h>
-#include <libcxml/cxml.h>
 #include "cinema.h"
+#include <libcxml/cxml.h>
+#include <libxml++/libxml++.h>
 
 using std::list;
 using boost::shared_ptr;
@@ -68,16 +68,20 @@ Cinema::remove_screen (shared_ptr<Screen> s)
 }
 
 Screen::Screen (cxml::ConstNodePtr node)
+       : name (node->string_child ("Name"))
 {
-       name = node->string_child ("Name");
-       certificate = shared_ptr<dcp::Certificate> (new dcp::Certificate (node->string_child ("Certificate")));
+       if (node->optional_string_child ("Certificate")) {
+               certificate = dcp::Certificate (node->string_child ("Certificate"));
+       }
 }
 
 void
 Screen::as_xml (xmlpp::Element* parent) const
 {
        parent->add_child("Name")->add_child_text (name);
-       parent->add_child("Certificate")->add_child_text (certificate->certificate (true));
+       if (certificate) {
+               parent->add_child("Certificate")->add_child_text (certificate->certificate (true));
+       }
 }
 
-               
+