Skip to content

impl: parseWords never sets WordsData.isColorSpecified — words color does not round-trip #207

Description

@webern

Same bug class fixed for segno/coda in PR #203. In DirectionReader::parseWords (DirectionReader.cpp:383):

outWords.colorData = getColor(wordEl);
// outWords.isColorSpecified is never set — stays false

getColor() returns an empty ColorData{} when the attribute is absent, so the caller must check checkHasColor and gate isColorSpecified accordingly. DirectionWriter only emits color when isColorSpecified is true, so the color silently drops on write.

Fix

Mirror the pattern already used in getPrintData (PrintFunctions.h:65-68):

if (checkHasColor(&wordEl))
{
    outWords.isColorSpecified = true;
    outWords.colorData = getColor(wordEl);
}

One-liner change; the same fix should be verified for parseRehearsal as well (it has the same call pattern).

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiIssues opened by, or through, a coding agent.area/mx::implbugsoftware defectnon-breakingfixes or implementation that do not require breaking changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions