Skip to content
Permalink
Browse files

fix crash on leaving text editing mode after undo

  • Loading branch information...
wschweer committed Jul 27, 2018
1 parent bd8d99c commit 44debd749dfc4c15176e3430d10b6f5dc9ce1f85
Showing with 4 additions and 10 deletions.
  1. +1 −1 libmscore/fret.cpp
  2. +2 −8 libmscore/textframe.cpp
  3. +1 −1 libmscore/undo.cpp
@@ -159,7 +159,7 @@ QLineF FretDiagram::dragAnchor() const
QPointF p1(xp, yp);
return QLineF(p1, canvasPos());
#if 0 // TODOxx
if (parent()->type() == ElementType::SEGMENT) {
if (parent()->isSegment()) {
Segment* s = toSegment(parent());
Measure* m = s->measure();
System* system = m->system();
@@ -133,13 +133,9 @@ Element* TBox::drop(EditData& data)
Element* e = data.element;
switch (e->type()) {
case ElementType::TEXT:
{
Text* t = toText(e);
_text->undoSetText(t->xmlText());
//TODO-ws _text->undoChangeProperty(Pid::SUB_STYLE, int(t->subStyle()));
_text->undoChangeProperty(Pid::TEXT, toText(e)->xmlText());
delete e;
return _text;
}
default:
return VBox::drop(data);
}
@@ -154,9 +150,7 @@ void TBox::add(Element* e)
{
if (e->isText()) {
// does not normally happen, since drop() handles this directly
Text* t = toText(e);
_text->undoSetText(t->xmlText());
//TODO-ws _text->undoChangeProperty(Pid::SUB_STYLE, int(t->subStyle()));
_text->undoChangeProperty(Pid::TEXT, toText(e)->xmlText());
}
else {
VBox::add(e);
@@ -271,7 +271,7 @@ void UndoStack::remove(int idx)
UndoCommand* cmd = list.takeLast();
cmd->cleanup(false); // delete elements for which UndoCommand() holds ownership
delete cmd;
--curIdx;
// --curIdx;
}
while (list.size() > idx) {
UndoCommand* cmd = list.takeLast();

0 comments on commit 44debd7

Please sign in to comment.
You can’t perform that action at this time.