]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/key-engraver.cc
release: 1.3.93
[lilypond.git] / lily / key-engraver.cc
index 9f1b66d1a6822835e3a121080ea387197a36ec01..110e6717e1e2fcb4ee929f6ee6a261fce852a605 100644 (file)
@@ -22,7 +22,8 @@
 /**
   Make the key signature.
  */
-class Key_engraver : public Engraver {
+class Key_engraver : public Engraver
+{
   void create_key(bool);
   void read_req (Key_change_req const * r);
 
@@ -37,6 +38,7 @@ public:
     
 protected:
   virtual void do_creation_processing();
+  virtual void do_removal_processing ();
   virtual bool do_try_music (Music *req_l);
   virtual void do_process_music();
   virtual void do_pre_move_processing();
@@ -45,6 +47,12 @@ protected:
 };
 
 
+void
+Key_engraver::do_removal_processing ()
+{
+  old_accs_ = SCM_EOL;         // unprotect can not  be called from dtor.
+}
+
 Key_engraver::Key_engraver ()
 {
   keyreq_l_ = 0;
@@ -76,10 +84,13 @@ Key_engraver::create_key (bool def)
       announce_element (item_p_,keyreq_l_);
     }
 
-  if (!def)
-    item_p_->set_elt_property ("visibility-lambda",
-                              scm_eval (ly_symbol2scm  ("all-visible")));
 
+  if (!def)
+    {
+      SCM vis = get_property ("explicitKeySignatureVisibility"); 
+      if (gh_procedure_p (vis))
+       item_p_->set_elt_property ("visibility-lambda",vis);
+    }
 }