Skip to content

Commit

Permalink
fix #116196: Crash applying line via double click (debug build)
Browse files Browse the repository at this point in the history
adding and using the proper CONVERT macros for NoteLine, VoltaSegment
and PedalSegment in the due course
  • Loading branch information
Jojo-Schmitz committed Jun 24, 2016
1 parent ae37ad9 commit 0f740c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
12 changes: 6 additions & 6 deletions libmscore/cmd.cpp
Expand Up @@ -291,12 +291,12 @@ void Score::cmdAddSpanner(Spanner* spanner, int staffIdx, Segment* startSegment,
else
tick2 = endSegment->tick();
spanner->setTick2(tick2);
if (spanner->type() == Element::Type::TEXTLINE
|| spanner->type() == Element::Type::NOTELINE
|| spanner->type() == Element::Type::OTTAVA
|| spanner->type() == Element::Type::PEDAL
|| spanner->type() == Element::Type::HAIRPIN
|| spanner->type() == Element::Type::VOLTA) {
if (spanner->isTextLine()
|| spanner->isNoteLine()
|| spanner->isOttavaSegment()
|| spanner->isPedalSegment()
|| spanner->isHairpinSegment()
|| spanner->isVoltaSegment()) {
// rebase text elements to score style
TextLine* tl = toTextLine(spanner);
TextStyleType st;
Expand Down
11 changes: 10 additions & 1 deletion libmscore/element.h
Expand Up @@ -94,6 +94,9 @@ class DurationElement;
class Accidental;
class TextLine;
class Pedal;
class NoteLine;
class VoltaSegment;
class PedalSegment;

enum class SymId;

Expand Down Expand Up @@ -706,6 +709,9 @@ class Element : public QObject, public ScoreElement {
CONVERT(TextLine, TEXTLINE)
CONVERT(Pedal, PEDAL)
CONVERT(OttavaSegment, OTTAVA_SEGMENT)
CONVERT(NoteLine, NOTELINE)
CONVERT(VoltaSegment, VOLTA_SEGMENT)
CONVERT(PedalSegment, PEDAL_SEGMENT)
#undef CONVERT
};

Expand Down Expand Up @@ -788,9 +794,12 @@ static inline const a* to##a(const Element* e) { Q_ASSERT(e == 0 || e->type() ==
CONVERT(Dynamic, DYNAMIC)
CONVERT(InstrumentName, INSTRUMENT_NAME)
CONVERT(Accidental, ACCIDENTAL)
CONVERT(TextLine, TEXTLINE)
CONVERT(TextLine, TEXTLINE)
CONVERT(Pedal, PEDAL)
CONVERT(OttavaSegment, OTTAVA_SEGMENT)
CONVERT(NoteLine, NOTELINE)
CONVERT(VoltaSegment, VOLTA_SEGMENT)
CONVERT(PedalSegment, PEDAL_SEGMENT)
#undef CONVERT

//---------------------------------------------------------
Expand Down

0 comments on commit 0f740c9

Please sign in to comment.