Skip to content

Commit

Permalink
Add text node for empty syl element when loading file
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Jun 29, 2023
1 parent 19f0674 commit a60713e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/iomei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3916,6 +3916,25 @@ bool MEIInput::ReadDoc(pugi::xml_node root)
m_doc->ConvertMarkupDoc(!m_doc->GetOptions()->m_preserveAnalyticalMarkup.GetValue());
}

// Add child to empty syl in facsimile mode for neume notation
if (success && (m_doc->GetType() == Facs) && (m_doc->m_notationType == NOTATIONTYPE_neume)) {
ListOfObjects syls = m_doc->FindAllDescendantsByType(SYL);
ListOfObjects::iterator iter = syls.begin();
while (iter != syls.end()) {
if (!(*iter)->GetChildCount()) {
Syl *syl = vrv_cast<Syl *>(*iter);
assert(syl);

Text *text = new Text();
std::u32string str = U"";

text->SetText(str);
syl->AddChild(text);
}
++iter;
}
}

if (success && !m_hasScoreDef) {
LogWarning("No scoreDef provided, trying to generate one...");
success = m_doc->GenerateDocumentScoreDef();
Expand Down

0 comments on commit a60713e

Please sign in to comment.