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

Factory methods will return non-NULL or throw

This commit is contained in:
Paul Licameli
2017-03-31 15:00:16 -04:00
parent f1b354b141
commit 6b84dc1c1d
9 changed files with 70 additions and 81 deletions

View File

@@ -2339,10 +2339,10 @@ bool LabelTrack::Save(wxTextFile * out, bool overwrite)
Track::Holder LabelTrack::Cut(double t0, double t1)
{
auto tmp = Copy(t0, t1);
if (!tmp)
return{};
if (!Clear(t0, t1))
return{};
//THROW_INCONSISTENCY_EXCEPTION
;
return tmp;
}
@@ -2353,8 +2353,7 @@ Track::Holder LabelTrack::SplitCut(double t0, double t1)
// SplitCut() == Copy() + SplitDelete()
Track::Holder tmp = Copy(t0, t1);
if (!tmp)
return {};
if (!SplitDelete(t0, t1))
return {};