From 9b920c78929dc3330db11378ba760624b37f792f Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Tue, 23 Aug 2022 15:55:26 +0200 Subject: [PATCH] folding: Always write fold data to file --- src/subtitle_format_ass.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/subtitle_format_ass.cpp b/src/subtitle_format_ass.cpp index 9117897ab..97fe61060 100644 --- a/src/subtitle_format_ass.cpp +++ b/src/subtitle_format_ass.cpp @@ -108,21 +108,20 @@ struct Writer { WriteIfNotZero("Scroll Position: ", properties.scroll_position); WriteIfNotZero("Active Line: ", properties.active_row); WriteIfNotZero("Video Position: ", properties.video_position); - - std::string foldsdata; - for (LineFold fold : properties.folds) { - if (!foldsdata.empty()) { - foldsdata += ","; - } - foldsdata += std::to_string(fold.start); - foldsdata += ":"; - foldsdata += std::to_string(fold.end); - foldsdata += ":"; - foldsdata += fold.collapsed ? "1" : "0"; - } - - WriteIfNotEmpty("Line Folds: ", foldsdata); } + + std::string foldsdata; + for (LineFold fold : properties.folds) { + if (!foldsdata.empty()) { + foldsdata += ","; + } + foldsdata += std::to_string(fold.start); + foldsdata += ":"; + foldsdata += std::to_string(fold.end); + foldsdata += ":"; + foldsdata += fold.collapsed ? "1" : "0"; + } + WriteIfNotEmpty("Line Folds: ", foldsdata); } void WriteIfNotEmpty(const char *key, std::string const& value) {