mirror of https://github.com/odrling/Aegisub
Don't call CompressForStack on copied AssFiles as the parsed data isn't copied in the first place.
Originally committed to SVN as r4671.
This commit is contained in:
parent
4897f35dfc
commit
002aad0b29
|
@ -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<AssDialogueBlock*>::iterator cur=Blocks.begin();cur!=Blocks.end();cur++) {
|
||||
delete *cur;
|
||||
}
|
||||
Blocks.clear();
|
||||
delete_clear(Blocks);
|
||||
}
|
||||
|
||||
bool AssDialogue::Parse(wxString rawData, int version) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<AssDialogue*>(*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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue