Skip to content

Commit

Permalink
fix #272138 Incorrect symbol in text on undoing nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed May 25, 2018
1 parent 24014b6 commit 2c612a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions libmscore/textedit.cpp
Expand Up @@ -109,6 +109,9 @@ bool TextBase::edit(EditData& ed)
// printf("======%x\n", s.isEmpty() ? -1 : s[0].unicode());

switch (ed.key) {
case Qt::Key_Z: // happens when the undo stack is empty
return true;

case Qt::Key_Enter:
case Qt::Key_Return:
deleteSelectedText(ed);
Expand Down
2 changes: 1 addition & 1 deletion mscore/events.cpp
Expand Up @@ -560,7 +560,7 @@ void ScoreView::keyPressEvent(QKeyEvent* ev)

if (!( (editData.modifiers & Qt::ShiftModifier) && (editData.key == Qt::Key_Backtab) )) {
if (editData.element->edit(editData)) {
if (editData.element->isText())
if (editData.element->isTextBase())
mscore->textTools()->updateTools(editData);
else
updateGrips();
Expand Down
3 changes: 1 addition & 2 deletions mscore/musescore.cpp
Expand Up @@ -3180,7 +3180,7 @@ void MuseScore::changeState(ScoreState val)

bool enable = (val != STATE_DISABLED) && (val != STATE_LOCK);

foreach (const Shortcut* s, Shortcut::shortcuts()) {
for (const Shortcut* s : Shortcut::shortcuts()) {
QAction* a = s->action();
if (!a)
continue;
Expand Down Expand Up @@ -3815,7 +3815,6 @@ void MuseScore::undoRedo(bool undo)
{
Q_ASSERT(cv);
Q_ASSERT(cs);
// if (_sstate & (STATE_EDIT | STATE_TEXT_EDIT | STATE_HARMONY_FIGBASS_EDIT | STATE_LYRICS_EDIT))
if (_sstate & (STATE_EDIT | STATE_HARMONY_FIGBASS_EDIT | STATE_LYRICS_EDIT))
cv->changeState(ViewState::NORMAL);
cv->startUndoRedo(undo);
Expand Down

0 comments on commit 2c612a8

Please sign in to comment.