Skip to content

Commit

Permalink
fix #276237: Crash after undo stave text entry and leaving edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcclinch committed Sep 17, 2018
1 parent 62800ec commit 1d8adad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
#include "stafflines.h"
#include "bracket.h"
#include "fret.h"
#include "textedit.h"

namespace Ms {

Expand Down Expand Up @@ -365,6 +366,13 @@ void UndoStack::setClean()
void UndoStack::undo(EditData* ed)
{
qCDebug(undoRedo) << "===";
// Are we currently editing text?
if (ed && ed->element && ed->element->isTextBase()) {
TextEditData* ted = static_cast<TextEditData*>(ed->getData(ed->element));
if (ted && ted->startUndoIdx == curIdx)
// No edits to undo, so do nothing
return;
}
if (curIdx) {
--curIdx;
Q_ASSERT(curIdx >= 0);
Expand Down

0 comments on commit 1d8adad

Please sign in to comment.