Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/engraving/dom/lyrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ void Score::forAllLyrics(std::function<void(Lyrics*)> f)
void Lyrics::undoChangeProperty(Pid id, const PropertyValue& v, PropertyFlags ps)
{
if (id == Pid::VERSE && verse() != v.toInt()) {
PartialLyricsLine* prevPartial = findPrevPartialLyricsLineDash(this);

for (Lyrics* l : chordRest()->lyrics()) {
if (l->verse() == v.toInt()) {
// verse already exists, swap
Expand All @@ -568,6 +570,10 @@ void Lyrics::undoChangeProperty(Pid id, const PropertyValue& v, PropertyFlags ps
}
}
TextBase::undoChangeProperty(id, v, ps);
if (prevPartial && prevPartial->verse() != v.toInt()) {
// Skip logic to update Lyrics by calling parent class
prevPartial->LyricsLine::undoChangeProperty(id, v, ps);
}
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/engraving/dom/lyrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class Lyrics final : public TextBase
PropertyValue getProperty(Pid propertyId) const override;
bool setProperty(Pid propertyId, const PropertyValue&) override;
PropertyValue propertyDefault(Pid id) const override;
void undoChangeProperty(Pid id, const PropertyValue&, PropertyFlags ps) override;
void triggerLayout() const override;

double yRelativeToStaff() const;
Expand All @@ -110,8 +111,6 @@ class Lyrics final : public TextBase
Lyrics(ChordRest* parent);
Lyrics(const Lyrics&);

void undoChangeProperty(Pid id, const PropertyValue&, PropertyFlags ps) override;

int m_verse = 0; // row index
Fraction m_ticks; // if > 0 then draw an underline to tick() + _ticks (melisma)
LyricsSyllabic m_syllabic = LyricsSyllabic::SINGLE;
Expand Down Expand Up @@ -229,6 +228,7 @@ class PartialLyricsLine final : public LyricsLine
bool setProperty(Pid propertyId, const PropertyValue&) override;
PropertyValue propertyDefault(Pid propertyId) const override;
Sid getPropertyStyle(Pid propertyId) const override;
void undoChangeProperty(Pid id, const PropertyValue&, PropertyFlags ps) override;

Lyrics* findLyricsInPreviousRepeatSeg() const;
Lyrics* findAdjacentLyricsOrDefault() const;
Expand Down
25 changes: 25 additions & 0 deletions src/engraving/dom/lyricsline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,31 @@ Sid PartialLyricsLine::getPropertyStyle(Pid propertyId) const
}
}

void PartialLyricsLine::undoChangeProperty(Pid id, const PropertyValue& v, PropertyFlags ps)
{
if (id == Pid::VERSE && verse() != v.toInt()) {
ChordRest* endCR = endElement()
&& endElement()->isChordRest() ? toChordRest(endElement()) : nullptr;
Lyrics* endLyrics = nullptr;
if (endCR) {
for (Lyrics* lyr : endCR->lyrics()) {
if (lyr->verse() == verse()) {
endLyrics = lyr;
break;
}
}
}

LyricsLine::undoChangeProperty(id, v, ps);
if (endLyrics && endLyrics->verse() != v.toInt()) {
endLyrics->undoChangeProperty(id, v, ps);
}
return;
}

LyricsLine::undoChangeProperty(id, v, ps);
}

void PartialLyricsLine::doComputeEndElement()
{
LyricsLine::doComputeEndElement();
Expand Down
1 change: 1 addition & 0 deletions src/engraving/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ set(MODULE_TEST_SRC
${CMAKE_CURRENT_LIST_DIR}/fretdiagram_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/engraving_xml_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/parentheses_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/lyrics_tests.cpp
${CMAKE_CURRENT_LIST_DIR}/automation/automation_tests.cpp

${CMAKE_CURRENT_LIST_DIR}/mocks/engravingconfigurationmock.h
Expand Down
231 changes: 231 additions & 0 deletions src/engraving/tests/lyrics_data/partialLyricsLineVerse.mscx
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="5.00">
<programVersion>5.0.0</programVersion>
<programRevision></programRevision>
<Score>
<eid>nKXCiaEoEhL_6aillYgKmGN</eid>
<Division>480</Division>
<showInvisible>1</showInvisible>
<showUnprintable>1</showUnprintable>
<showFrames>1</showFrames>
<showMargins>0</showMargins>
<open>1</open>
<metaTag name="arranger"></metaTag>
<metaTag name="audioComUrl"></metaTag>
<metaTag name="composer">Composer / arranger</metaTag>
<metaTag name="copyright"></metaTag>
<metaTag name="creationDate">2026-05-11</metaTag>
<metaTag name="lyricist"></metaTag>
<metaTag name="movementNumber"></metaTag>
<metaTag name="movementTitle"></metaTag>
<metaTag name="platform">Apple Macintosh</metaTag>
<metaTag name="source"></metaTag>
<metaTag name="sourceRevisionId"></metaTag>
<metaTag name="translator"></metaTag>
<metaTag name="workNumber"></metaTag>
<metaTag name="workTitle">Untitled score</metaTag>
<Order id="orchestra">
<name>Orchestra</name>
<instrument id="flute">
<family id="flutes">Flutes</family>
</instrument>
<section id="woodwind" brackets="true" barLineSpan="true" thinBrackets="true">
<family>flutes</family>
<family>oboes</family>
<family>clarinets</family>
<family>saxophones</family>
<family>bassoons</family>
<unsorted group="woodwinds"/>
</section>
<section id="brass" brackets="true" barLineSpan="true" thinBrackets="true">
<family>horns</family>
<family>trumpets</family>
<family>cornets</family>
<family>flugelhorns</family>
<family>trombones</family>
<family>tubas</family>
<unsorted group="brass"/>
</section>
<section id="timpani" brackets="true" barLineSpan="true" thinBrackets="true">
<family>timpani</family>
</section>
<section id="percussion" brackets="true" barLineSpan="true" thinBrackets="true">
<family>keyboard-percussion</family>
<unsorted group="pitched-percussion"/>
<family>drums</family>
<family>unpitched-metal-percussion</family>
<family>unpitched-wooden-percussion</family>
<family>other-percussion</family>
<unsorted group="unpitched-percussion"/>
</section>
<family>keyboards</family>
<family>harps</family>
<family>organs</family>
<family>synths</family>
<unsorted/>
<soloists/>
<section id="voices" brackets="true" barLineSpan="false" thinBrackets="true">
<family>voices</family>
<family>voice-groups</family>
</section>
<section id="strings" brackets="true" barLineSpan="true" thinBrackets="true">
<family>orchestral-strings</family>
</section>
</Order>
<Part id="1">
<eid>t4wOfNXvET_MB7K3yCV9bO</eid>
<Staff>
<eid>CG/iy0suU5M_8apoiL+qw2P</eid>
<StaffType group="pitched">
<name>stdNormal</name>
</StaffType>
</Staff>
<Instrument id="flute">
<InstrumentLabel>
<longName>Flute</longName>
<shortName>Fl.</shortName>
</InstrumentLabel>
<trackName>Flute</trackName>
<minPitchP>59</minPitchP>
<maxPitchP>98</maxPitchP>
<minPitchA>60</minPitchA>
<maxPitchA>93</maxPitchA>
<instrumentId>wind.flutes.flute</instrumentId>
<Channel>
<program value="73"/>
<synti>Fluid</synti>
</Channel>
</Instrument>
</Part>
<Staff id="1">
<Measure>
<eid>mKe/djNTwGI_s1XmcbjJpUL</eid>
<endRepeat>2</endRepeat>
<voice>
<KeySig>
<eid>cUnqv/ph9gI_LPTcl7EN5KB</eid>
<concertKey>0</concertKey>
</KeySig>
<TimeSig>
<eid>XgRNHq69m7K_S3NLE+JPF5K</eid>
<sigN>4</sigN>
<sigD>4</sigD>
</TimeSig>
<Spanner type="Volta">
<Volta>
<endHookType>1</endHookType>
<beginText>1.</beginText>
<eid>+t9p05H+WZE_dUtgtdQFXUJ</eid>
<endings>1</endings>
</Volta>
<next>
<location>
<measures>1</measures>
</location>
</next>
</Spanner>
<Rest>
<eid>28VKFi2fDqK_9xUWGpjsqy</eid>
<durationType>measure</durationType>
<duration>4/4</duration>
</Rest>
</voice>
</Measure>
<Measure>
<eid>Xr5lOYXqQ3N_cA97Vqf75gL</eid>
<voice>
<Spanner type="Volta">
<prev>
<location>
<measures>-1</measures>
</location>
</prev>
</Spanner>
<Spanner type="PartialLyricsLine">
<PartialLyricsLine>
<isEndMelisma>0</isEndMelisma>
<eid>a396oaBKAiJ_VRT1nJG6RCJ</eid>
</PartialLyricsLine>
<next>
<location>
<fractions>3/4</fractions>
</location>
</next>
</Spanner>
<Spanner type="Volta">
<Volta>
<beginText>2.</beginText>
<eid>4xcpnAOTAoL_n4evRtiDRJG</eid>
<endings>2</endings>
</Volta>
<next>
<location>
<fractions>1/1</fractions>
</location>
</next>
</Spanner>
<Chord>
<eid>3CiytIHP3RJ_ALMjoc/8kLJ</eid>
<durationType>quarter</durationType>
<Note>
<eid>m7fQthHZQJO_7DgH01TN/EM</eid>
<pitch>67</pitch>
<tpc>15</tpc>
</Note>
</Chord>
<Chord>
<eid>fvBsBY0kU4M_oSukTnvYBhB</eid>
<durationType>quarter</durationType>
<Note>
<eid>Rb2Rvj8SSME_zaNY72NA+cI</eid>
<pitch>67</pitch>
<tpc>15</tpc>
</Note>
</Chord>
<Chord>
<eid>iWINXjjGjhC_hyQB/0KmcXO</eid>
<durationType>quarter</durationType>
<Note>
<eid>zkh7KqvN1tI_uzBzYEU/fTD</eid>
<pitch>67</pitch>
<tpc>15</tpc>
</Note>
</Chord>
<Spanner type="PartialLyricsLine">
<prev>
<location>
<fractions>-3/4</fractions>
</location>
</prev>
</Spanner>
<Chord>
<eid>VwNj0yokoxC_HzD3rfGZTsB</eid>
<durationType>quarter</durationType>
<Lyrics>
<syllabic>end</syllabic>
<eid>z+ILmWw4Gq_BSmKiWdn0aD</eid>
<text>l1</text>
</Lyrics>
<Lyrics>
<no>1</no>
<eid>6REO+yewDvG_38oVnz2lL2D</eid>
<text>l2</text>
</Lyrics>
<Note>
<eid>o/LBWL7i30E_B9M2co1VMIE</eid>
<pitch>67</pitch>
<tpc>15</tpc>
</Note>
</Chord>
<Spanner type="Volta">
<prev>
<location>
<fractions>-1/1</fractions>
</location>
</prev>
</Spanner>
</voice>
</Measure>
</Staff>
</Score>
</museScore>
Loading
Loading