remove UndoCommand ChangeStretch

This commit is contained in:
ws 2015-06-17 09:21:09 +02:00
parent 154b427f81
commit af19f5c9e3
3 changed files with 2 additions and 37 deletions

View file

@ -1573,7 +1573,7 @@ void Score::resetUserStretch()
return; return;
for (Measure* m = m1; m; m = m->nextMeasureMM()) { for (Measure* m = m1; m; m = m->nextMeasureMM()) {
undo(new ChangeStretch(m, 1.0)); m->undoChangeProperty(P_ID::USER_STRETCH, 1.0);
if (m == m2) if (m == m2)
break; break;
} }
@ -1654,7 +1654,7 @@ void Score::cmdAddStretch(qreal val)
stretch += val; stretch += val;
if (stretch < 0) if (stretch < 0)
stretch = 0; stretch = 0;
undo(new ChangeStretch(m, stretch)); m->undoChangeProperty(P_ID::USER_STRETCH, stretch);
} }
_layoutAll = true; _layoutAll = true;
} }

View file

@ -2662,27 +2662,6 @@ void AddTextStyle::redo()
score->style()->addTextStyle(style); score->style()->addTextStyle(style);
} }
//---------------------------------------------------------
// ChangeStretch
//---------------------------------------------------------
ChangeStretch::ChangeStretch(Measure* m, qreal s)
: measure(m), stretch(s)
{
}
//---------------------------------------------------------
// flip
//---------------------------------------------------------
void ChangeStretch::flip()
{
qreal oStretch = measure->userStretch();
measure->setUserStretch(stretch);
measure->score()->setLayoutAll(true);
stretch = oStretch;
}
//--------------------------------------------------------- //---------------------------------------------------------
// ChangeStyle // ChangeStyle
//--------------------------------------------------------- //---------------------------------------------------------

View file

@ -744,20 +744,6 @@ class AddTextStyle : public UndoCommand {
UNDO_NAME("AddTextStyle") UNDO_NAME("AddTextStyle")
}; };
//---------------------------------------------------------
// ChangeStretch
//---------------------------------------------------------
class ChangeStretch : public UndoCommand {
Measure* measure;
qreal stretch;
void flip();
public:
ChangeStretch(Measure*, qreal);
UNDO_NAME("ChangeStretch")
};
//--------------------------------------------------------- //---------------------------------------------------------
// ChangeStyle // ChangeStyle
//--------------------------------------------------------- //---------------------------------------------------------