diff --git a/aegisub/src/ass_attachment.h b/aegisub/src/ass_attachment.h index 093af65bd..54b1e5111 100644 --- a/aegisub/src/ass_attachment.h +++ b/aegisub/src/ass_attachment.h @@ -46,7 +46,8 @@ public: /// @param raw If false, remove the SSA filename mangling std::string GetFileName(bool raw=false) const; - std::string GetEntryData() const override { return entry_data; } + std::string const& GetEntryData() const { return entry_data; } + std::string const& GetSSAText() const { return entry_data; } AssEntryGroup Group() const override { return group; } AssAttachment(AssAttachment const& rgt); diff --git a/aegisub/src/ass_dialogue.h b/aegisub/src/ass_dialogue.h index 2c590c71a..7dae6ae37 100644 --- a/aegisub/src/ass_dialogue.h +++ b/aegisub/src/ass_dialogue.h @@ -170,10 +170,10 @@ public: /// Update the text of the line from parsed blocks void UpdateText(boost::ptr_vector& blocks); - std::string GetEntryData() const override { return GetData(false); } + std::string GetEntryData() const { return GetData(false); } /// Get the line as SSA rather than ASS - std::string GetSSAText() const override { return GetData(true); } + std::string GetSSAText() const { return GetData(true); } /// Does this line collide with the passed line? bool CollidesWith(const AssDialogue *target) const; diff --git a/aegisub/src/ass_entry.h b/aegisub/src/ass_entry.h index 5ab2df012..f03d10336 100644 --- a/aegisub/src/ass_entry.h +++ b/aegisub/src/ass_entry.h @@ -57,10 +57,4 @@ public: /// ASS or SSA Section header for this entry's group std::string const& GroupHeader(bool ssa=false) const; - - /// @brief Get this line's raw entry data in ASS format - virtual std::string GetEntryData() const=0; - - /// Get this line in SSA format - virtual std::string GetSSAText() const { return GetEntryData(); } }; diff --git a/aegisub/src/ass_info.h b/aegisub/src/ass_info.h index 32b7792ae..de4601749 100644 --- a/aegisub/src/ass_info.h +++ b/aegisub/src/ass_info.h @@ -27,8 +27,8 @@ public: AssInfo(std::string key, std::string value) : key(std::move(key)), value(std::move(value)) { } AssEntryGroup Group() const override { return AssEntryGroup::INFO; } - std::string GetEntryData() const override { return key + ": " + value; } - std::string GetSSAText() const override { return boost::iequals(key, "scripttype: v4.00+") ? "ScriptType: v4.00" : GetEntryData(); } + std::string GetEntryData() const { return key + ": " + value; } + std::string GetSSAText() const { return boost::iequals(key, "scripttype: v4.00+") ? "ScriptType: v4.00" : GetEntryData(); } std::string Key() const { return key; } std::string Value() const { return value; } diff --git a/aegisub/src/ass_style.h b/aegisub/src/ass_style.h index 14dac5d00..61a6a1fef 100644 --- a/aegisub/src/ass_style.h +++ b/aegisub/src/ass_style.h @@ -77,8 +77,8 @@ public: AssStyle(); AssStyle(std::string const& data, int version=1); - std::string GetEntryData() const override { return data; } - std::string GetSSAText() const override; + std::string const& GetEntryData() const { return data; } + std::string GetSSAText() const ; AssEntryGroup Group() const override { return AssEntryGroup::STYLE; } /// Convert an ASS alignment to the equivalent SSA alignment diff --git a/aegisub/src/auto4_lua_assfile.cpp b/aegisub/src/auto4_lua_assfile.cpp index ecb77e661..3747b2f47 100644 --- a/aegisub/src/auto4_lua_assfile.cpp +++ b/aegisub/src/auto4_lua_assfile.cpp @@ -147,14 +147,15 @@ namespace Automation4 { lua_newtable(L); set_field(L, "section", e->GroupHeader()); - set_field(L, "raw", e->GetEntryData()); if (AssInfo *info = dynamic_cast(e)) { + set_field(L, "raw", info->GetEntryData()); set_field(L, "key", info->Key()); set_field(L, "value", info->Value()); set_field(L, "class", "info"); } else if (AssDialogue *dia = dynamic_cast(e)) { + set_field(L, "raw", dia->GetEntryData()); set_field(L, "comment", dia->Comment); set_field(L, "layer", dia->Layer); @@ -176,6 +177,7 @@ namespace Automation4 { set_field(L, "class", "dialogue"); } else if (AssStyle *sty = dynamic_cast(e)) { + set_field(L, "raw", sty->GetEntryData()); set_field(L, "name", sty->name); set_field(L, "fontname", sty->font);