From 31e89a7c18eb607873ff6948587b1ab32d59b6b1 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Wed, 22 May 2024 12:04:45 -0400 Subject: [PATCH] Update octaves for affected custodes --- src/editortoolkit_neume.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/editortoolkit_neume.cpp b/src/editortoolkit_neume.cpp index a1891a25e2e..39a192f97ec 100644 --- a/src/editortoolkit_neume.cpp +++ b/src/editortoolkit_neume.cpp @@ -1588,19 +1588,26 @@ bool EditorToolkitNeume::DisplaceClefOctave(std::string elementId, std::string d clef->SetDisPlace(octaveDis > 0 ? STAFFREL_basic_above : STAFFREL_basic_below); } - // Set new octaves for affected neume components + // Set new octaves for affected neume components and custodes ClassIdComparison equalsClef(CLEF); Clef *nextClef = dynamic_cast(page->FindNextChild(&equalsClef, clef)); ClassIdComparison equalsNcs(NC); ListOfObjects ncs; page->FindAllDescendantsBetween(&ncs, &equalsNcs, clef, nextClef); - std::for_each(ncs.begin(), ncs.end(), [&](Object *ncObj) { Nc *nc = dynamic_cast(ncObj); nc->SetOct(nc->GetOct() + move); }); + ClassIdComparison equalsCustodes(CUSTOS); + ListOfObjects custodes; + page->FindAllDescendantsBetween(&custodes, &equalsCustodes, clef, nextClef); + std::for_each(custodes.begin(), custodes.end(), [&](Object *custosObj) { + Custos *custos = dynamic_cast(custosObj); + custos->SetOct(custos->GetOct() + move); + }); + m_editInfo.import("status", "OK"); m_editInfo.import("message", ""); return true;