We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cf3779 commit ccc8713Copy full SHA for ccc8713
libmscore/dynamic.cpp
@@ -320,8 +320,11 @@ void Dynamic::startEdit(EditData& ed)
320
void Dynamic::endEdit(EditData& ed)
321
{
322
TextBase::endEdit(ed);
323
- if (xmlText() != QString::fromUtf8(dynList[int(_dynamicType)].text))
324
- _dynamicType = Type::OTHER;
+ auto text = xmlText();
+ auto it = std::find_if(std::begin(dynList), std::end(dynList), [text](const Ms::Dyn& d) { return text == QString::fromUtf8(d.text); });
325
+ _dynamicType = it == std::end(dynList) ? Type::OTHER : static_cast<Type>(it - std::begin(dynList));
326
+ for (auto* e : this->linkList())
327
+ toDynamic(e)->_dynamicType = _dynamicType;
328
}
329
330
//---------------------------------------------------------
0 commit comments