summaryrefslogtreecommitdiff
path: root/src/lib/subtitle_analysis.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-02-06 10:58:39 +0100
committerCarl Hetherington <cth@carlh.net>2024-02-22 22:46:02 +0100
commit6d95d9689831a74fade32038a808f206c03d8aa2 (patch)
treeb2d8fb562fd0da399f7d259fc82c1760b22a9402 /src/lib/subtitle_analysis.cc
parent3ffd0163026be24e5373e0674c3301ed37546e44 (diff)
FIXME: Remove all use of add_child() from xmlpp.no-add-child
Needs bump of libcxml.
Diffstat (limited to 'src/lib/subtitle_analysis.cc')
-rw-r--r--src/lib/subtitle_analysis.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/subtitle_analysis.cc b/src/lib/subtitle_analysis.cc
index ff1969a3a..2968416c6 100644
--- a/src/lib/subtitle_analysis.cc
+++ b/src/lib/subtitle_analysis.cc
@@ -70,18 +70,18 @@ SubtitleAnalysis::write (boost::filesystem::path path) const
auto doc = make_shared<xmlpp::Document>();
xmlpp::Element* root = doc->create_root_node ("SubtitleAnalysis");
- root->add_child("Version")->add_child_text (raw_convert<string>(_current_state_version));
+ cxml::add_text_child(root, "Version", raw_convert<string>(_current_state_version));
if (_bounding_box) {
- auto bounding_box = root->add_child("BoundingBox");
- bounding_box->add_child("X")->add_child_text(raw_convert<string>(_bounding_box->x));
- bounding_box->add_child("Y")->add_child_text(raw_convert<string>(_bounding_box->y));
- bounding_box->add_child("Width")->add_child_text(raw_convert<string>(_bounding_box->width));
- bounding_box->add_child("Height")->add_child_text(raw_convert<string>(_bounding_box->height));
+ auto bounding_box = cxml::add_child(root, "BoundingBox");
+ cxml::add_text_child(bounding_box, "X", raw_convert<string>(_bounding_box->x));
+ cxml::add_text_child(bounding_box, "Y", raw_convert<string>(_bounding_box->y));
+ cxml::add_text_child(bounding_box, "Width", raw_convert<string>(_bounding_box->width));
+ cxml::add_text_child(bounding_box, "Height", raw_convert<string>(_bounding_box->height));
}
- root->add_child("AnalysisXOffset")->add_child_text(raw_convert<string>(_analysis_x_offset));
- root->add_child("AnalysisYOffset")->add_child_text(raw_convert<string>(_analysis_y_offset));
+ cxml::add_text_child(root, "AnalysisXOffset", raw_convert<string>(_analysis_x_offset));
+ cxml::add_text_child(root, "AnalysisYOffset", raw_convert<string>(_analysis_y_offset));
doc->write_to_file_formatted (path.string());
}