From a82d7518c910b5a705f25b9a98106acd343bba8d Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Fri, 1 Dec 2023 17:14:09 -0500 Subject: [PATCH] Set column value for newly inserted staff if has columns --- src/editortoolkit_neume.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/editortoolkit_neume.cpp b/src/editortoolkit_neume.cpp index 67f5dc19638..048d90eba4c 100644 --- a/src/editortoolkit_neume.cpp +++ b/src/editortoolkit_neume.cpp @@ -782,10 +782,12 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in if (elementType == "staff") { Object *parent; Staff *newStaff; + std::string columnValue; // Use closest existing staff (if there is one) if (staff) { parent = staff->GetParent(); assert(parent); + columnValue = staff->GetType(); int n = parent->GetChildCount() + 1; newStaff = new Staff(n); newStaff->m_drawingStaffDef = staff->m_drawingStaffDef; @@ -810,6 +812,7 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in assert(surface); surface->AddChild(zone); newStaff->AttachZone(zone); + if (columnValue.length()) newStaff->SetType(columnValue); Layer *newLayer = new Layer(); newStaff->AddChild(newLayer);