[4.7] Allow deleting and dragging parentheses#33919
Conversation
📝 WalkthroughWalkthroughTwo small changes are made to parenthesis element handling in the engraving domain. In 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/engraving/dom/chord.cpp (1)
783-800: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winAdd a
breakafter articulation/tapping removal to prevent unintended fallthrough.Line 792 currently executes for articulation/ornament/tapping removals too, because the case at Lines 783-791 has no terminating
break. That routes non-parenthesis elements into parenthesis-removal logic and can trigger assertion/early-return paths while skipping expected removal lifecycle handling.Proposed fix
case ElementType::ARTICULATION: case ElementType::ORNAMENT: case ElementType::TAPPING: { Articulation* a = toArticulation(e); if (!muse::remove(m_articulations, a)) { LOGD("Chord::remove(): articulation not found"); } } + break; case ElementType::PARENTHESIS: { NoteParenthesisInfo* parenInfo = findNoteParenthesisInfo(toParenthesis(e)); IF_ASSERT_FAILED(parenInfo) { LOGD() << "Chord::remove(): This parenthesis does not belong to this chord"; return; } EditChord::removeChordParentheses(this, parenInfo->notes()); break; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/engraving/dom/chord.cpp` around lines 783 - 800, The switch statement for element type removal is missing a break statement after the block handling ElementType::ARTICULATION, ElementType::ORNAMENT, and ElementType::TAPPING cases. Add a break statement immediately after the closing brace of that case block (after the muse::remove and logging code) to prevent unintended fallthrough into the ElementType::PARENTHESIS case, which would cause non-parenthesis elements to be processed by parenthesis removal logic and skip expected removal lifecycle handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/engraving/dom/chord.cpp`:
- Around line 783-800: The switch statement for element type removal is missing
a break statement after the block handling ElementType::ARTICULATION,
ElementType::ORNAMENT, and ElementType::TAPPING cases. Add a break statement
immediately after the closing brace of that case block (after the muse::remove
and logging code) to prevent unintended fallthrough into the
ElementType::PARENTHESIS case, which would cause non-parenthesis elements to be
processed by parenthesis removal logic and skip expected removal lifecycle
handling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c60b8f57-f6b6-4fe4-97e2-8854a28bdb4d
📒 Files selected for processing (2)
src/engraving/dom/chord.cppsrc/engraving/dom/parenthesis.cpp
f936918 to
20d13ed
Compare
20d13ed to
e8ac3ca
Compare
Resolves: #33812