New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #116196: Crash applying line via double click (debug build) #2690
Conversation
Well, this PR does not completely solve the problem. If you try to add a hairpin with a double click from the palette you still hit the Q_ASSERT at line 737 of libmscore\element.h (referring to line 791 of element.h); the ottava case is solved since with this PR it no more goes inside the if-clause of line 294 of libmscore\cmd.cpp and therefore does not hit the "TextLine* tl = toTextLine(spanner)" instruction. |
970799e
to
66b5cf7
Compare
Change to HairpinSegment and VoltaSegment seems to fix that. There is no PedalSegment though, not sure what to do about this? Edit: Ah, found PedalSegment and PEDAL_SEGMENT |
3c6284b
to
bbc5702
Compare
But that means it is now just completely skipping the if-clause of line 294 of cmd.cpp. Should it be removed then? |
bbc5702
to
0f740c9
Compare
Hmm, just reverting back to |
0f740c9
to
24c8ee5
Compare
OK, let's try another Approach then |
@@ -732,6 +734,18 @@ static inline const DurationElement* toDurationElement(const Element* e) { | |||
|| e->type() == Element::Type::REPEAT_MEASURE || e->type() == Element::Type::TUPLET); | |||
return (const DurationElement*)e; | |||
} | |||
static inline TextLine* toTextLine(Element* e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe toSortOfTextLine()
instead?
5e4c40b
to
69a89c2
Compare
adding and using the proper CONVERT macros for isNoteLine() and toNoteLine() as well as methods for isTextLineType() and toTextLineType() in the due course
69a89c2
to
f6a885e
Compare
Seems this got made obsolete by 0b92b20 ? |
After a weekend of thinking, Werner changed his mind and he believe "that in this special case a dynamic_cast may be faster and its the intended semantic". See 0b92b20 |
Done, see #2735, but it isn't used anywhere |
No description provided.