diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-10 13:22:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | cc76b517f6a74f813ae38137bdc88ff3bafa6dd9 (patch) | |
| tree | 34c2960763f897936efef689898a1f392fb38375 /src/lib/subtitle_content.cc | |
| parent | a3073b3059e8df6304d2936ab2c605e6908a7373 (diff) | |
Allow content parts to not be preset in XML.
Diffstat (limited to 'src/lib/subtitle_content.cc')
| -rw-r--r-- | src/lib/subtitle_content.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index 228376c34..89953b0e5 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -66,6 +66,16 @@ SubtitleContent::SubtitleContent (Content* parent, shared_ptr<const Film> film) } +shared_ptr<SubtitleContent> +SubtitleContent::from_xml (Content* parent, shared_ptr<const Film> film, cxml::ConstNodePtr node, int version) +{ + if (!node->optional_number_child<double>("SubtitleXOffset") && !node->optional_number_child<double>("SubtitleOffset")) { + return shared_ptr<SubtitleContent> (); + } + + return shared_ptr<SubtitleContent> (new SubtitleContent (parent, film, node, version)); +} + SubtitleContent::SubtitleContent (Content* parent, shared_ptr<const Film> film, cxml::ConstNodePtr node, int version) : ContentPart (parent, film) , _use (false) |
