[1.0] Brackets on accidentals not saved (with code change)

• Jan 22, 2011 - 14:14
Type
Functional
Severity
S2 - Critical
Status
closed
Project

Looks like the fix to #8727: [1.0] Crash when saving score with displaced parethesized accidentals broke saving accidental brackets.

In a new file, enter two notes (g and a)
select g and press up (it gets a sharp)
drag a sharp from the palette to the a
drag round brackets from the palette to both sharps

Save file in mscx format. After loading this file the brackets are missing.
Note: brackets are not exported to MusicXML either.

Screenshot (before saving) and file saved attached.


Comments

Title [1.0] Brackets on accidentals not saved [1.0] Brackets on accidentals not saved (with code change)

I think the problem is in function void Note::write() const in file note.cpp, line 561-2:

if (_accidental && (!_accidental->userOff().isNull() || !_accidental->visible())

should read:

if (_accidental && (!_accidental->userOff().isNull() || !_accidental->visible() || _accidental->hasBracket())

This is a minimalistic change. A possibly better approach could be to let the accidental itself to decide if it is customized or not:

if (_accidental && _accidental->hasProperties())

providing a suitable Accidental::hasProperties() (or however named) function.

M.

Status (old) active fixed

The minimalistic aproach is ok. The trunk unconditionally writes out the accidental.
This is fixed in r3945.