Skip to content

Commit

Permalink
Merge pull request #22798 from mathesoncalum/22758-remove_instrument_…
Browse files Browse the repository at this point in the history
…names

FIx #22758: Allow deletion of instrument names
  • Loading branch information
mathesoncalum committed May 13, 2024
2 parents 7c10c7e + d90df45 commit 0a22551
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/engraving/dom/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2400,9 +2400,21 @@ void Score::deleteItem(EngravingItem* el)
if (!el) {
return;
}
// cannot remove generated elements
if (el->generated() && !(el->isBracket() || el->isBarLine() || el->isClef() || el->isMeasureNumber() || el->isKeySig())) {
return;

if (el->generated()) {
switch (el->type()) {
// These types can be removed, even if generated
case ElementType::BAR_LINE:
case ElementType::BRACKET:
case ElementType::CLEF:
case ElementType::INSTRUMENT_NAME:
case ElementType::KEYSIG:
case ElementType::MEASURE_NUMBER:
break;
// All other types cannot be removed if generated
default:
return;
}
}
// LOGD("%s", el->typeName());

Expand Down

0 comments on commit 0a22551

Please sign in to comment.