Skip to content

api: round-trip drops clef-octave-change when value is 0 #257

Description

@webern

Split from #229.

What

PropertiesWriter.cpp:218 uses if (inClefData.octaveChange != 0) as a guard, which drops
<clef-octave-change>0</clef-octave-change> from the output. Zero is a valid value meaning
"no octave transposition" and must be emitted when present in the source.

Fix

Add bool isOctaveChangeSpecified to ClefData (mirrors the existing isLineSpecified pattern).
Set it in the reader when <clef-octave-change> is present. Check it in the writer instead of
!= 0.

Impact

14 corpus files have this as a divergence signature (drop:clef-octave-change).

Files

  • src/include/mx/api/ClefData.h
  • src/private/mx/impl/PropertiesWriter.cpp:218
  • Reader site that parses <clef-octave-change>

Metadata

Metadata

Assignees

No one assigned

    Labels

    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