Skip to content

Commit

Permalink
update text editing
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed May 19, 2017
1 parent 847d365 commit 9384654
Show file tree
Hide file tree
Showing 19 changed files with 581 additions and 619 deletions.
4 changes: 2 additions & 2 deletions libmscore/cmd.cpp
Expand Up @@ -151,9 +151,9 @@ void Score::undoRedo(bool undo, EditData& ed)
deselectAll();
cmdState().reset();
if (undo)
undoStack()->undo(ed);
undoStack()->undo(&ed);
else
undoStack()->redo(ed);
undoStack()->redo(&ed);
update();
updateSelection();
}
Expand Down
8 changes: 4 additions & 4 deletions libmscore/edit.cpp
Expand Up @@ -3148,7 +3148,7 @@ void Score::undoPropertyChanged(Element* e, P_ID t, const QVariant& st)
// property in linked element has not changed yet
// push() calls redo() to change it
if (ee->getProperty(t) != e->getProperty(t))
undoStack()->push(new ChangeProperty(ee, t, e->getProperty(t)));
undoStack()->push(new ChangeProperty(ee, t, e->getProperty(t)), 0);
}
}
}
Expand Down Expand Up @@ -3194,7 +3194,7 @@ void Score::undoChangePitch(Note* note, int pitch, int tpc1, int tpc2)
{
for (ScoreElement* e : note->linkList()) {
Note* n = static_cast<Note*>(e);
undoStack()->push(new ChangePitch(n, pitch, tpc1, tpc2));
undoStack()->push(new ChangePitch(n, pitch, tpc1, tpc2), 0);
}
}

Expand All @@ -3213,11 +3213,11 @@ void Score::undoChangeFretting(Note* note, int pitch, int string, int fret, int
if (l) {
for (ScoreElement* e : *l) {
Note* n = static_cast<Note*>(e);
undoStack()->push(new ChangeFretting(n, pitch, string, fret, tpc1, tpc2));
undo(new ChangeFretting(n, pitch, string, fret, tpc1, tpc2));
}
}
else
undoStack()->push(new ChangeFretting(note, pitch, string, fret, tpc1, tpc2));
undo(new ChangeFretting(note, pitch, string, fret, tpc1, tpc2));
}

//---------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions libmscore/score.cpp
Expand Up @@ -3255,9 +3255,9 @@ void Score::cmdSelectSection()
// undo
//---------------------------------------------------------

void Score::undo(UndoCommand* cmd) const
void Score::undo(UndoCommand* cmd, EditData* ed) const
{
undoStack()->push(cmd);
undoStack()->push(cmd, ed);
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion libmscore/score.h
Expand Up @@ -622,7 +622,7 @@ class Score : public QObject, ScoreElement {
void undoPropertyChanged(Element*, P_ID, const QVariant& v);
void undoPropertyChanged(ScoreElement*, P_ID, const QVariant& v);
inline virtual UndoStack* undoStack() const;
void undo(UndoCommand* cmd) const;
void undo(UndoCommand*, EditData* = 0) const;
void undoRemoveMeasures(Measure*, Measure*);
void undoAddBracket(Staff* staff, int level, BracketType type, int span);
void undoRemoveBracket(Bracket*);
Expand Down

0 comments on commit 9384654

Please sign in to comment.