Skip to content

Commit

Permalink
fix #78636: insert before frame fails
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella authored and lasconic committed Mar 12, 2016
1 parent 2607d3b commit 8def5bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions libmscore/edit.cpp
Expand Up @@ -2766,8 +2766,12 @@ static MeasureBase* searchMeasureBase(Score* score, MeasureBase* mb)
}
}
else {
if (!mb->links())
qDebug("searchMeasureBase: no links");
if (!mb->links()) {
if (mb->score() == score)
return mb;
else
qDebug("searchMeasureBase: no links");
}
else {
for (ScoreElement* m : *mb->links()) {
if (m->score() == score)
Expand Down Expand Up @@ -2835,7 +2839,7 @@ MeasureBase* Score::insertMeasure(Element::Type type, MeasureBase* measure, bool
}

Measure* m = static_cast<Measure*>(mb);
Measure* mi = static_cast<Measure*>(im);
Measure* mi = im ? score->tick2measure(im->tick()) : nullptr;
m->setTimesig(f);
m->setLen(f);
ticks = m->ticks();
Expand Down
2 changes: 1 addition & 1 deletion mscore/scoreview.cpp
Expand Up @@ -5386,7 +5386,7 @@ MeasureBase* ScoreView::checkSelectionStateForInsertMeasure()

Element* e = _score->selection().element();
if (e) {
if (e->type() == Element::Type::VBOX || e->type() == Element::Type::TBOX)
if (e->type() == Element::Type::VBOX || e->type() == Element::Type::TBOX || e->type() == Element::Type::HBOX)
return static_cast<MeasureBase*>(e);
}
QMessageBox::warning(0, "MuseScore",
Expand Down

0 comments on commit 8def5bc

Please sign in to comment.