]> git.donarmstrong.com Git - lilypond.git/commit - lily/include/stream-event.hh
Make inherited stream event properties immutable.
authorDavid Kastrup <dak@gnu.org>
Fri, 20 Jan 2012 11:01:03 +0000 (12:01 +0100)
committerDavid Kastrup <dak@gnu.org>
Sat, 21 Jan 2012 08:49:33 +0000 (09:49 +0100)
commite8f544af29c93145d122efa8dcfc0548d9b84f0b
tree6232560cd77c194293a52a31b66756209b97b919
parent09ae845ea458bc35ffa486b4bcac25c88e2fb856
Make inherited stream event properties immutable.

Previously, the initialization of stream events from the (mutable) part
of music event properties was done by just taking the mutable property list.
That had the effect that any changes to the inherited properties were
reflected in the originating music event, making a mockery of the
mutable/immutable distinction intended to provide copy-on-write
semantics.  As an example, the conversion of the articulations
property to events might or might not already have happened if the music
event got reported more than once, like it is done in \repeat unfold.

The change had the unexpected side effect of making quoted transposed
music fail since the transposition worked exclusively on the mutable
property list part.  This has been fixed by adding a make_transposable
member function to Stream_event that copies affected properties from
the immutable to the mutable part before one attempts transposition.

The source code has not yet been combed through for instances where
stream events have been manually cloned to avoid the bad side effects
of the original code.
lily/include/stream-event.hh
lily/music.cc
lily/quote-iterator.cc
lily/stream-event.cc