From 002aad0b29183206d8a2b6780f218010b148e66f Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 11 Jul 2010 03:31:19 +0000 Subject: [PATCH] Don't call CompressForStack on copied AssFiles as the parsed data isn't copied in the first place. Originally committed to SVN as r4671. --- aegisub/src/ass_dialogue.cpp | 11 ++--------- aegisub/src/ass_dialogue.h | 3 --- aegisub/src/ass_file.cpp | 9 --------- aegisub/src/ass_file.h | 2 -- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/aegisub/src/ass_dialogue.cpp b/aegisub/src/ass_dialogue.cpp index 705c8cdaf..216b1e98d 100644 --- a/aegisub/src/ass_dialogue.cpp +++ b/aegisub/src/ass_dialogue.cpp @@ -108,18 +108,11 @@ AssDialogue::AssDialogue(wxString _data,int version) } AssDialogue::~AssDialogue () { - Clear(); -} - -void AssDialogue::Clear () { - ClearBlocks(); + delete_clear(Blocks); } void AssDialogue::ClearBlocks() { - for (std::vector::iterator cur=Blocks.begin();cur!=Blocks.end();cur++) { - delete *cur; - } - Blocks.clear(); + delete_clear(Blocks); } bool AssDialogue::Parse(wxString rawData, int version) { diff --git a/aegisub/src/ass_dialogue.h b/aegisub/src/ass_dialogue.h index 33243b326..4ed3abe79 100644 --- a/aegisub/src/ass_dialogue.h +++ b/aegisub/src/ass_dialogue.h @@ -220,9 +220,6 @@ public: const wxString GetEntryData() const; /// Do nothing void SetEntryData(wxString) { } - /// Synonym for ClearBlocks - void Clear(); - /// @brief Set a margin /// @param value New value of the margin diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index d1efac841..dc061e83a 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -766,20 +766,12 @@ wxString AssFile::GetWildcardList(int mode) { else return _T(""); } -void AssFile::CompressForStack() { - for (entryIter cur=Line.begin();cur!=Line.end();cur++) { - AssDialogue *diag = dynamic_cast(*cur); - if (diag) diag->ClearBlocks(); - } -} - int AssFile::Commit(wxString desc, int amendId) { ++commitId; // Allow coalescing only if it's the last change and the file has not been // saved since the last change if (commitId == amendId+1 && RedoStack.empty() && savedCommitId != commitId) { UndoStack.back() = *this; - UndoStack.back().CompressForStack(); return commitId; } @@ -788,7 +780,6 @@ int AssFile::Commit(wxString desc, int amendId) { // Place copy on stack undoDescription = desc; UndoStack.push_back(*this); - UndoStack.back().CompressForStack(); // Cap depth int depth = OPT_GET("Limits/Undo Levels")->GetInt(); diff --git a/aegisub/src/ass_file.h b/aegisub/src/ass_file.h index fb5113eff..8fc41b506 100644 --- a/aegisub/src/ass_file.h +++ b/aegisub/src/ass_file.h @@ -88,8 +88,6 @@ public: /// Clear the file void Clear(); - /// Discard some parsed data to reduce the size of the undo stack - void CompressForStack(); /// @brief Load default file /// @param defline Add a blank line to the file void LoadDefault(bool defline=true);