From f80740363455d4c78f4132f9e58006a84034b9d0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 25 Jul 2018 14:00:19 +0100 Subject: Fix loading of old projects. --- src/lib/text_content.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index 7c3c27d45..ee29ae8c4 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -121,6 +121,7 @@ TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version) , _line_spacing (node->optional_number_child("LineSpacing").get_value_or (1)) , _outline_width (node->optional_number_child("OutlineWidth").get_value_or (2)) , _type (TEXT_OPEN_SUBTITLE) + , _original_type (TEXT_OPEN_SUBTITLE) { if (version >= 37) { _use = node->bool_child ("Use"); @@ -224,9 +225,11 @@ 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")); - if (node->optional_string_child("OriginalType")) { - _original_type = string_to_text_type (node->optional_string_child("OriginalType").get()); + if (version >= 37) { + _type = string_to_text_type (node->optional_string_child("Type").get_value_or("open")); + if (node->optional_string_child("OriginalType")) { + _original_type = string_to_text_type (node->optional_string_child("OriginalType").get()); + } } } -- cgit v1.2.3