Skip to content

Commit cccb11a

Browse files
committed
Fix #303422: Importing colored lyrics from MusicXML
Up to 3.5 it worked only for first line (number="1"), in 3.6 and master it stopped working all together Backport of musescore#8033, resp. duplicate of musescore#8034. See also musescore#6021
1 parent ff46cb3 commit cccb11a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

importexport/musicxml/importmxmlpass2.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5359,8 +5359,10 @@ void MusicXMLParserLyric::parse()
53595359

53605360
//qDebug("formatted lyric '%s'", qPrintable(formattedText));
53615361
lyric->setXmlText(formattedText);
5362-
if (lyricColor != QColor::Invalid)
5363-
lyric->setColor(lyricColor);
5362+
if (lyricColor != QColor::Invalid) {
5363+
lyric->setProperty(Pid::COLOR, lyricColor);
5364+
lyric->setPropertyFlags(Pid::COLOR, PropertyFlags::UNSTYLED);
5365+
}
53645366

53655367
const auto l = lyric.release();
53665368
_numberedLyrics[lyricNo] = l;

mtest/musicxml/io/testLyricColor.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@
185185
<syllabic>single</syllabic>
186186
<text>blue.</text>
187187
</lyric>
188+
<lyric number="2" color="#9541E8">
189+
<syllabic>single</syllabic>
190+
<text>purple.</text>
191+
</lyric>
188192
</note>
189193
<barline location="right">
190194
<bar-style>light-heavy</bar-style>

0 commit comments

Comments
 (0)