Skip to content

Commit a82d751

Browse files
committed
Set column value for newly inserted staff if has columns
1 parent d3d0f8f commit a82d751

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/editortoolkit_neume.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,12 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in
782782
if (elementType == "staff") {
783783
Object *parent;
784784
Staff *newStaff;
785+
std::string columnValue;
785786
// Use closest existing staff (if there is one)
786787
if (staff) {
787788
parent = staff->GetParent();
788789
assert(parent);
790+
columnValue = staff->GetType();
789791
int n = parent->GetChildCount() + 1;
790792
newStaff = new Staff(n);
791793
newStaff->m_drawingStaffDef = staff->m_drawingStaffDef;
@@ -810,6 +812,7 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in
810812
assert(surface);
811813
surface->AddChild(zone);
812814
newStaff->AttachZone(zone);
815+
if (columnValue.length()) newStaff->SetType(columnValue);
813816
Layer *newLayer = new Layer();
814817
newStaff->AddChild(newLayer);
815818

0 commit comments

Comments
 (0)