projects
/
libdcp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Various attempts to clean up DCP comparison code.
[libdcp.git]
/
src
/
load_font.cc
diff --git
a/src/load_font.cc
b/src/load_font.cc
index 707f4a0b54b07357dc54bab234334d63c54e0d4c..b46569c8ea5701593b336e0ccb3e210cf14f85ff 100644
(file)
--- a/
src/load_font.cc
+++ b/
src/load_font.cc
@@
-20,11
+20,18
@@
#include "load_font.h"
#include <libcxml/cxml.h>
#include "load_font.h"
#include <libcxml/cxml.h>
+using std::string;
using boost::shared_ptr;
using boost::shared_ptr;
+using boost::optional;
using namespace dcp;
LoadFont::LoadFont (boost::shared_ptr<const cxml::Node> node)
{
using namespace dcp;
LoadFont::LoadFont (boost::shared_ptr<const cxml::Node> node)
{
- id = node->string_attribute ("Id");
- uri = node->string_attribute ("URI");
+ optional<string> x = node->optional_string_attribute ("Id");
+ if (!x) {
+ x = node->optional_string_attribute ("ID");
+ }
+ id = x.get_value_or ("");
+
+ uri = node->optional_string_attribute ("URI");
}
}