Bug 2743 - The first use of the "window" command in LOF files is ignored by Audacity

This commit is contained in:
James Crook 2021-04-14 19:10:44 +01:00
parent 224053f0ff
commit bef40f0ab9
2 changed files with 7 additions and 3 deletions

View File

@ -971,8 +971,9 @@ void ProjectFileManager::OpenFile(const FilePath &fileNameArg, bool addtohistory
{
Import(fileName);
}
window.ZoomAfterImport(nullptr);
// Bug 2743: Don't zoom with lof.
if (!fileName.AfterLast('.').IsSameAs(wxT("lof"), false))
window.ZoomAfterImport(nullptr);
return;
}

View File

@ -309,6 +309,7 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
wxString targetfile;
wxString tokenholder = tok.GetNextToken();
if (tokenholder.IsSameAs(wxT("window"), false))
{
// set any duration/offset factors for last window, as all files were called
@ -501,7 +502,9 @@ void LOFImportFileHandle::doDurationAndScrollOffset()
if (!mProject)
return;
callScrollOffset = callScrollOffset && (scrollOffset != 0);
bool doSomething = callDurationFactor || callScrollOffset;
if (callDurationFactor)
{
double longestDuration = TrackList::Get( *mProject ).GetEndTime();
@ -509,7 +512,7 @@ void LOFImportFileHandle::doDurationAndScrollOffset()
callDurationFactor = false;
}
if (callScrollOffset && (scrollOffset != 0))
if (callScrollOffset)
{
ProjectWindow::Get( *mProject ).TP_ScrollWindow(scrollOffset);
callScrollOffset = false;