Skip to content

Commit

Permalink
Add text node for new syl element
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed Jun 29, 2023
1 parent db3f721 commit 19f0674
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/editortoolkit_neume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,11 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in
surface->AddChild(zone);
zone->SetUlx(ulx);

Text *text = new Text();
std::u32string str = U"";
text->SetText(str);
syl->AddChild(text);

neume->AddChild(nc);
syllable->AddChild(neume);
syllable->AddChild(syl);
Expand Down Expand Up @@ -1778,6 +1783,11 @@ bool EditorToolkitNeume::SetText(std::string elementId, const std::string &text)
Syl *syl = vrv_cast<Syl *>(syllable->GetFirst(SYL));
if (syl == NULL) {
syl = new Syl();
Text *text = new Text();
std::u32string str = U"";
text->SetText(str);
syl->AddChild(text);

syllable->AddChild(syl);
Text *textChild = new Text();
textChild->SetText(wtext);
Expand Down Expand Up @@ -2453,6 +2463,8 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector<std::string> e
// Ensure a syl is created so text can be added to syllable
Syl *syl = new Syl();
Text *text = new Text();
std::u32string str = U"";
text->SetText(str);
syl->AddChild(text);
parent->AddChild(syl);

Expand Down Expand Up @@ -2915,6 +2927,8 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector<std::string>
syllables.push_back(newParent);
Syl *syl = new Syl();
Text *text = new Text();
std::u32string str = U"";
text->SetText(str);
syl->AddChild(text);
newParent->AddChild(syl);

Expand Down

0 comments on commit 19f0674

Please sign in to comment.