diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-23 16:42:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-23 16:42:28 +0100 |
| commit | 24dcab1d4d8d7a28a939c7c4d786197684f155f6 (patch) | |
| tree | cdd795a6caff66d17e35ed97fbb8b8d39f4fe9fc /src/lib/text_content.cc | |
| parent | a5c629cb9b638b67a0e4c2d26fe9ab2e124bf0eb (diff) | |
Introduce the idea of unknown original subtitle type to clean up the GUI a bit.
Diffstat (limited to 'src/lib/text_content.cc')
| -rw-r--r-- | src/lib/text_content.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index 011c42f35..761ffc6b7 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -57,7 +57,7 @@ int const TextContentProperty::FADE_OUT = 513; int const TextContentProperty::OUTLINE_WIDTH = 514; int const TextContentProperty::TYPE = 515; -TextContent::TextContent (Content* parent, TextType original_type) +TextContent::TextContent (Content* parent, TextType type, TextType original_type) : ContentPart (parent) , _use (false) , _burn (false) @@ -67,7 +67,7 @@ TextContent::TextContent (Content* parent, TextType original_type) , _y_scale (1) , _line_spacing (1) , _outline_width (2) - , _type (original_type) + , _type (type) , _original_type (original_type) { @@ -121,7 +121,6 @@ TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version) , _line_spacing (node->optional_number_child<double>("LineSpacing").get_value_or (1)) , _outline_width (node->optional_number_child<int>("OutlineWidth").get_value_or (2)) , _type (TEXT_OPEN_SUBTITLE) - , _original_type (TEXT_OPEN_SUBTITLE) { if (version >= 37) { _use = node->bool_child ("Use"); @@ -226,7 +225,9 @@ TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version) connect_to_fonts (); _type = string_to_text_type (node->optional_string_child("Type").get_value_or("open")); - _original_type = string_to_text_type (node->optional_string_child("OriginalType").get_value_or("open")); + if (node->optional_string_child("OriginalType")) { + _original_type = string_to_text_type (node->optional_string_child("OriginalType").get()); + } } TextContent::TextContent (Content* parent, vector<shared_ptr<Content> > c) |
