From 10a529ad512ba600a4a1e07d32988501b4812002 Mon Sep 17 00:00:00 2001 From: "Maurizio M. Gavioli" Date: Sat, 18 May 2013 15:02:47 +0200 Subject: [PATCH] Fix #21121 - Pasting unstyled text causes crash Fixed in ChordRest::drop() by checking for proper text style. --- libmscore/chordrest.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libmscore/chordrest.cpp b/libmscore/chordrest.cpp index ff1a3862d3ad..384f81e76caa 100644 --- a/libmscore/chordrest.cpp +++ b/libmscore/chordrest.cpp @@ -834,7 +834,7 @@ Element* ChordRest::drop(const DropData& data) { Text* f = static_cast(e); int st = f->textStyleType(); - if (st != TEXT_STYLE_UNKNOWN) + if (st >= TEXT_STYLE_DEFAULT) f->setTextStyleType(st); } score()->undoAddElement(e); @@ -848,9 +848,8 @@ Element* ChordRest::drop(const DropData& data) fb->setTrack( (track() / VOICES) * VOICES ); fb->setTicks( duration().ticks() ); fb->setOnNote(true); - /* FiguredBass * fbNew =*/ FiguredBass::addFiguredBassToSegment(segment(), + FiguredBass::addFiguredBassToSegment(segment(), fb->track(), fb->ticks(), &bNew); - // fbNew = fb; if (bNew) score()->undoAddElement(e); return e;