Skip to content

Commit

Permalink
fix another regression for score creation
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Mar 3, 2015
1 parent 7d2e05d commit e492636
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mscore/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ void MuseScore::newFile()
if (pickupMeasure)
measures += 1;

Score* score = new Score(MScore::defaultStyle());
Score* score;
QString tp = newWizard->templatePath();

QList<Excerpt*> excerpts;
Expand All @@ -499,10 +499,10 @@ void MuseScore::newFile()
Score::FileError rv = Ms::readScore(tscore, tp, false);
if (rv != Score::FileError::FILE_NO_ERROR) {
readScoreError(newWizard->templatePath(), rv, false);
delete score;
delete tscore;
return;
}
score = new Score(tscore->style());
// create instruments from template
for (Part* tpart : tscore->parts()) {
Part* part = new Part(score);
Expand Down Expand Up @@ -535,8 +535,10 @@ void MuseScore::newFile()
excerpts.append(x);
}
}
else
else {
score = new Score(MScore::defaultStyle());
newWizard->createInstruments(score);
}
score->setCreated(true);
score->fileInfo()->setFile(createDefaultName());

Expand Down Expand Up @@ -612,7 +614,7 @@ void MuseScore::newFile()
}
}
else {
if (rest)
if (rest && staff->linkedStaves())
rest = static_cast<Rest*>(rest->linkedClone());
else
rest = new Rest(score, TDuration(TDuration::DurationType::V_MEASURE));
Expand Down

0 comments on commit e492636

Please sign in to comment.