1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Bug2570 residual: Compact should not change last saved state...

... So that if you save, edit, compact, close without saving, then reopen,
you recover the saved state as expected, not the compacted state.

Implications:

Do not push an undo state for compaction.  Discard redo states instead.

Do not purge undo states after the last saved.  The database still needs them.
So we might reclaim less space than before.
This commit is contained in:
Paul Licameli
2020-11-18 15:01:02 -05:00
parent 16b249ab9f
commit 7edbad3cd1
3 changed files with 35 additions and 24 deletions

View File

@@ -148,6 +148,7 @@ class AUDACITY_DLL_API UndoManager final
UndoPush flags = UndoPush::NONE);
void ModifyState(const TrackList * l,
const SelectedRegion &selectedRegion, const std::shared_ptr<Tags> &tags);
void AbandonRedo();
void ClearStates();
void RemoveStates(
size_t begin, //!< inclusive start of range
@@ -183,6 +184,7 @@ class AUDACITY_DLL_API UndoManager final
bool RedoAvailable();
bool UnsavedChanges() const;
int GetSavedState() const;
void StateSaved();
// Return value must first be calculated by CalculateSpaceUsage():