code review fix
This commit is contained in:
parent
7f54afaf9f
commit
4769f59e60
|
@ -475,12 +475,6 @@ void EngravingObject::undoChangeProperty(Pid id, const PropertyValue& v, Propert
|
|||
toEngravingItem(this)->manageExclusionFromParts(v.toBool());
|
||||
}
|
||||
}
|
||||
} else if (id == Pid::REPEAT_START || id == Pid::REPEAT_END) {
|
||||
// change also coresponding mmRestMeasure
|
||||
Measure* m = const_cast<Measure*>(toMeasure(this)->coveringMMRestOrThis());
|
||||
if (m != this) {
|
||||
m->undoChangeProperty(id, v);
|
||||
}
|
||||
}
|
||||
changeProperties(this, id, v, ps);
|
||||
if (id != Pid::GENERATED) {
|
||||
|
|
|
@ -2712,6 +2712,30 @@ PropertyValue Measure::propertyDefault(Pid propertyId) const
|
|||
return MeasureBase::propertyDefault(propertyId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// undoChangeProperty
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Measure::undoChangeProperty(Pid id, const PropertyValue& v)
|
||||
{
|
||||
undoChangeProperty(id, v, propertyFlags(id));
|
||||
}
|
||||
|
||||
void Measure::undoChangeProperty(Pid id, const PropertyValue& v, PropertyFlags ps)
|
||||
{
|
||||
if ((getProperty(id) == v) && (propertyFlags(id) == ps)) {
|
||||
return;
|
||||
}
|
||||
if (id == Pid::REPEAT_START || id == Pid::REPEAT_END) {
|
||||
// change also coresponding mmRestMeasure
|
||||
Measure* m = const_cast<Measure*>(toMeasure(this)->coveringMMRestOrThis());
|
||||
if (m != this) {
|
||||
m->undoChangeProperty(id, v);
|
||||
}
|
||||
}
|
||||
EngravingObject::undoChangeProperty(id, v, ps);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// mmRestFirst
|
||||
// this is a multi measure rest
|
||||
|
|
|
@ -300,6 +300,9 @@ public:
|
|||
bool setProperty(Pid propertyId, const PropertyValue&) override;
|
||||
PropertyValue propertyDefault(Pid) const override;
|
||||
|
||||
void undoChangeProperty(Pid id, const PropertyValue& newValue);
|
||||
void undoChangeProperty(Pid id, const PropertyValue& newValue, PropertyFlags ps) override;
|
||||
|
||||
bool hasMMRest() const { return m_mmRest != 0; }
|
||||
bool isMMRest() const { return m_mmRestCount > 0; }
|
||||
Measure* mmRest() const { return m_mmRest; }
|
||||
|
|
Loading…
Reference in a new issue