X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fclef-modifier.cc;h=c6ce950fc04a64ab5a6abf28bdaa05fda706876f;hb=0e10173ca92b8a12b37bf95cbb672889951636de;hp=6d802ad2710948b271a669469f992be44f29dd2c;hpb=21a1e3b8267fd76ff261ed9f01e833d5d04703e7;p=lilypond.git diff --git a/lily/clef-modifier.cc b/lily/clef-modifier.cc index 6d802ad271..c6ce950fc0 100644 --- a/lily/clef-modifier.cc +++ b/lily/clef-modifier.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2014--2014 Janek Warchoł + Copyright (C) 2014--2015 Janek Warchoł LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,23 +22,19 @@ struct Clef_modifier { DECLARE_SCHEME_CALLBACK (calc_parent_alignment, (SCM)); - DECLARE_GROB_INTERFACE (); }; MAKE_SCHEME_CALLBACK (Clef_modifier, calc_parent_alignment, 1) SCM Clef_modifier::calc_parent_alignment (SCM smob) { - Grob *me = Grob::unsmob (smob); + Grob *me = unsmob (smob); Grob *clef = me->get_parent (X_AXIS); string full_clef_name = ly_scm2string (clef->get_property ("glyph")); - - int separator_position = full_clef_name.find ('.'); - string clef_type = full_clef_name.substr (separator_position + 1, - separator_position + 2); + string clef_name = replace_all(&full_clef_name, "clefs.", ""); // find entry with keyname clef_type in clef-alignments - SCM alist_entry = scm_assq (ly_symbol2scm (clef_type.c_str ()), + SCM alist_entry = scm_assq (ly_symbol2scm (clef_name.c_str ()), me->get_property ("clef-alignments")); if (scm_is_pair (alist_entry))