Add page locks to palette#34243
Conversation
📝 WalkthroughWalkthroughThe update adds 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were 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.
🧹 Nitpick comments (2)
src/notation/internal/notationinteraction.cpp (2)
2521-2525: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAvoid variable shadowing.
The
txvariable is already declared in the function scope (line 2426). You can safely reuse it to avoid shadowing and potential-Wshadowcompiler warnings.♻️ Proposed fix
case ActionIconType::PAGE_LOCK: { - engraving::Transaction& tx = score->transactionManager()->currentOrDummyTransaction(); EditPageLocks::togglePageLock(tx, score, score->selection().pagesContainingSelection()); return; }🤖 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/notation/internal/notationinteraction.cpp` around lines 2521 - 2525, In the PAGE_LOCK branch of the notation interaction handler, remove the inner tx declaration and reuse the existing function-scope tx variable when calling EditPageLocks::togglePageLock. Preserve the current transaction selection and page-lock behavior.
3416-3419: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove redundant empty check before clear.
Checking
empty()beforeclear()is unnecessary becausestd::vector::clear()handles empty vectors natively and efficiently.♻️ Proposed fix
- if (!edd.dropRects.empty()) { - edd.dropRects.clear(); - } + edd.dropRects.clear();🤖 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/notation/internal/notationinteraction.cpp` around lines 3416 - 3419, In the drop-rectangle cleanup block, remove the redundant empty check and invoke edd.dropRects.clear() directly. Preserve the existing cleanup behavior and surrounding control flow.
🤖 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.
Nitpick comments:
In `@src/notation/internal/notationinteraction.cpp`:
- Around line 2521-2525: In the PAGE_LOCK branch of the notation interaction
handler, remove the inner tx declaration and reuse the existing function-scope
tx variable when calling EditPageLocks::togglePageLock. Preserve the current
transaction selection and page-lock behavior.
- Around line 3416-3419: In the drop-rectangle cleanup block, remove the
redundant empty check and invoke edd.dropRects.clear() directly. Preserve the
existing cleanup behavior and surrounding control flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 91241522-f57e-406e-8808-07b4ecd924bc
📒 Files selected for processing (21)
musesrc/engraving/dom/actionicon.hsrc/engraving/dom/measure.cppsrc/engraving/editing/edit.cppsrc/engraving/editing/editpagelocks.cppsrc/engraving/editing/editpagelocks.hsrc/engraving/editing/editsystemlocks.cppsrc/engraving/editing/mscoreview.hsrc/engraving/rw/read500/tread.cppsrc/notation/inotationinteraction.hsrc/notation/internal/notationinteraction.cppsrc/notation/internal/notationinteraction.hsrc/notation/internal/scorecallbacks.cppsrc/notation/internal/scorecallbacks.hsrc/notation/tests/mocks/notationinteractionmock.hsrc/notationscene/internal/notationuiactions.cppsrc/notationscene/widgets/exampleview.cppsrc/notationscene/widgets/exampleview.hsrc/palette/internal/palettecompat.cppsrc/palette/internal/palettecompat.hsrc/palette/internal/palettecreator.cpp
|
Can we have page locks for 4.7 too, please? Seems this PR needs a rebase |
Resolves: #33875