fix #271145: Changing Dynamic Range for hairpins lead to crash

This commit is contained in:
ws 2018-04-13 18:07:58 +02:00
parent a322ad33cb
commit 47dd40114b
3 changed files with 34 additions and 7 deletions

View file

@ -332,7 +332,10 @@ void Glissando::layout()
s->layout();
return;
}
if (spannerSegments().empty()) {
qDebug("no segments");
return;
}
SLine::layout();
setPos(0.0, 0.0);
adjustReadPos();

View file

@ -385,7 +385,15 @@ QVariant HairpinSegment::getProperty(Pid id) const
if (spp->pid == id)
return spanner()->getProperty(id);
}
return TextLineBaseSegment::getProperty(id);
switch (id) {
case Pid::VELO_CHANGE:
case Pid::HAIRPIN_TYPE:
case Pid::HAIRPIN_CIRCLEDTIP:
case Pid::DYNAMIC_RANGE:
return spanner()->getProperty(id);
default:
return TextLineBaseSegment::getProperty(id);
}
}
//---------------------------------------------------------
@ -398,7 +406,15 @@ bool HairpinSegment::setProperty(Pid id, const QVariant& v)
if (spp->pid == id)
return spanner()->setProperty(id, v);
}
return TextLineBaseSegment::setProperty(id, v);
switch (id) {
case Pid::VELO_CHANGE:
case Pid::HAIRPIN_TYPE:
case Pid::HAIRPIN_CIRCLEDTIP:
case Pid::DYNAMIC_RANGE:
return spanner()->setProperty(id, v);
default:
return TextLineBaseSegment::setProperty(id, v);
}
}
//---------------------------------------------------------
@ -411,7 +427,15 @@ QVariant HairpinSegment::propertyDefault(Pid id) const
if (spp->pid == id)
return spanner()->propertyDefault(id);
}
return TextLineBaseSegment::propertyDefault(id);
switch (id) {
case Pid::VELO_CHANGE:
case Pid::HAIRPIN_TYPE:
case Pid::HAIRPIN_CIRCLEDTIP:
case Pid::DYNAMIC_RANGE:
return spanner()->propertyDefault(id);
default:
return TextLineBaseSegment::propertyDefault(id);
}
}
//---------------------------------------------------------

View file

@ -718,14 +718,14 @@ QPointF SLine::linePos(Grip grip, System** sys) const
}
break;
case Spanner::Anchor::NOTE:
{
case Spanner::Anchor::NOTE: {
Element* e = grip == Grip::START ? startElement() : endElement();
if (!e)
return QPointF();
System* s = toNote(e)->chord()->segment()->system();
if (s == 0) {
qFatal("no system: %s start %s chord parent %s\n", name(), e->name(), toNote(e)->chord()->parent()->name());
qDebug("no system: %s start %s chord parent %s\n", name(), e->name(), toNote(e)->chord()->parent()->name());
return QPointF();
}
*sys = s;
// return the position of the anchor note relative to the system