void
-StringTextFileContent::as_xml (xmlpp::Node* node, bool with_paths) const
+StringTextFileContent::as_xml(xmlpp::Element* element, bool with_paths) const
{
- node->add_child("Type")->add_child_text("TextSubtitle");
- Content::as_xml (node, with_paths);
+ cxml::add_text_child(element, "Type", "TextSubtitle");
+ Content::as_xml(element, with_paths);
if (only_text()) {
- only_text()->as_xml(node);
+ only_text()->as_xml(element);
}
- node->add_child("Length")->add_child_text(raw_convert<string>(_length.get ()));
+ cxml::add_text_child(element, "Length", raw_convert<string>(_length.get()));
}
auto names = font_names(file);
auto content = only_text();
- auto legacy_font_file = content->get_font("font")->file();
+ optional<boost::filesystem::path> legacy_font_file;
+ if (auto legacy_font = content->get_font("font")) {
+ legacy_font_file = legacy_font->file();
+ }
for (auto name: names) {
if (!content->get_font(name)) {