Skip to content

Commit

Permalink
fix #24572
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Feb 24, 2014
1 parent a530d25 commit 46bdce7
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
4 changes: 2 additions & 2 deletions libmscore/excerpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void cloneStaves(Score* oscore, Score* score, const QList<int>& map)
int dstTrack2 = -1;
int st = 0;
//always export voltas to first staff in part
if(s->type() == Element::VOLTA)
if (s->type() == Element::VOLTA)
dstTrack = s->voice();
else { //export other spanner if staffidx matches
for (int index : map) {
Expand Down Expand Up @@ -469,7 +469,7 @@ void cloneStaff(Staff* srcStaff, Staff* dstStaff)
int staffIdx = s->staffIdx();
int dstTrack = -1;
int dstTrack2 = -1;
if(s->type() != Element::VOLTA) {
if (s->type() != Element::VOLTA) {
//export other spanner if staffidx matches
if (srcStaffIdx == staffIdx) {
dstTrack = dstStaffIdx * VOICES + s->voice();
Expand Down
20 changes: 10 additions & 10 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,6 @@ void Score::doLayout()
e->layout();
}
}

for (const std::pair<int,Spanner*>& s : _spanner.map()) {
Spanner* sp = s.second;
if (sp->type() == Element::OTTAVA && sp->tick2() == -1) {
Expand All @@ -732,17 +731,14 @@ void Score::doLayout()
if (sp->tick() == -1) {
qDebug("bad spanner id %d %s %d - %d", sp->id(), sp->name(), sp->tick(), sp->tick2());
}
else {
else
sp->layout();
}
}
}

if (layoutMode() != LayoutLine) {
layoutSystems2();
layoutPages(); // create list of pages
}

for (Measure* m = firstMeasureMM(); m; m = m->nextMeasureMM())
m->layout2();

Expand Down Expand Up @@ -949,9 +945,13 @@ static bool validMMRestMeasure(Measure* m)
{
if (!m->isEmpty())
return false;
//auto sl = m->score()->spannerMap().findOverlapping(m->tick(), m->endTick());
//if (!sl.empty())
// return false;

auto l = m->score()->spannerMap().findOverlapping(m->tick(), m->endTick());
for (::Interval<Spanner*> isp : l) {
Spanner* s = isp.value;
if (s->type() == Element::VOLTA && (s->tick() == m->tick() || s->tick2() == m->tick()))
return false;
}
for (Segment* s = m->first(); s; s = s->next()) {
for (Element* e : s->annotations()) {
if (e->type() != Element::REHEARSAL_MARK &&
Expand All @@ -976,8 +976,8 @@ static bool breakMultiMeasureRest(Measure* m)
auto sl = m->score()->spannerMap().findOverlapping(m->tick(), m->endTick());
foreach (auto i, sl) {
Spanner* s = i.value;
if(s->type() == Element::VOLTA) {
if(s->tick() == m->tick() || s->tick2() == m->tick())
if (s->type() == Element::VOLTA) {
if (s->tick() == m->tick() || s->tick2() == m->tick())
return true;
}
}
Expand Down
1 change: 0 additions & 1 deletion libmscore/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ QPointF SLine::linePos(int grip, System** sys)
}
}
}

Q_ASSERT(m->system());
*sys = m->system();
}
Expand Down
2 changes: 1 addition & 1 deletion libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ void Measure::cmdRemoveStaves(int sStaff, int eStaff)
foreach(Element* e, s->annotations()) {
int staffIdx = e->staffIdx();
if ((staffIdx >= sStaff) && (staffIdx < eStaff)) {
qDebug(" remove annotation %s staffIdx %d", e->name(), staffIdx);
qDebug(" remove annotation %s %p staffIdx %d", e->name(), e, staffIdx);
_score->undoRemoveElement(e);
}
}
Expand Down
4 changes: 4 additions & 0 deletions libmscore/segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,10 @@ void Segment::fixStaffIdx()

void Segment::checkEmpty() const
{
if (!_annotations.empty()) {
empty = false;
return;
}
empty = true;
foreach(const Element* e, _elist) {
if (e) {
Expand Down
4 changes: 3 additions & 1 deletion libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,8 +1226,10 @@ void Score::undoRemoveElement(Element* element)
}
}
for (Segment* s : segments) {
if (s->isEmpty())
if (s->isEmpty()) {
qDebug("remove empty segment %s %p", s->subTypeName(), s);
undo(new RemoveElement(s));
}
}
}

Expand Down
7 changes: 5 additions & 2 deletions mscore/debugger/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2009,8 +2009,11 @@ void VoltaView::setElement(Element* e)
sp.segments->addTopLevelItem(item);
}

// sp.startElement->setEnabled(volta->startElement() != 0);
// sp.endElement->setEnabled(volta->endElement() != 0);
sp.tick->setValue(volta->tick());
sp.tick2->setValue(volta->tick2());
sp.track2->setValue(volta->track2());
sp.startElement->setEnabled(volta->startElement() != 0);
sp.endElement->setEnabled(volta->endElement() != 0);
sp.anchor->setCurrentIndex(int(volta->anchor()));

tlb.beginText->setEnabled(volta->beginText());
Expand Down

0 comments on commit 46bdce7

Please sign in to comment.