]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-spanner-engraver.cc
Imported Upstream version 2.14.2
[lilypond.git] / lily / text-spanner-engraver.cc
index e5b9911810099f3100c24e5822fbb74e0e4399cc..c18bf098f2e03855dbfa4096b9d29331805abd96 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  text-spanner-engraver.cc -- implement Text_spanner_engraver
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2000--2011 Jan Nieuwenhuizen <janneke@gnu.org>
 
-  (c) 2000--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "engraver.hh"
@@ -41,8 +52,7 @@ Text_spanner_engraver::Text_spanner_engraver ()
   finished_ = 0;
   current_event_ = 0;
   span_ = 0;
-  event_drul_[START] = 0;
-  event_drul_[STOP] = 0;
+  event_drul_.set (0, 0);
 }
 
 IMPLEMENT_TRANSLATOR_LISTENER (Text_spanner_engraver, text_span);
@@ -108,8 +118,7 @@ Text_spanner_engraver::stop_translation_timestep ()
     }
 
   typeset_all ();
-  event_drul_[START] = 0;
-  event_drul_[STOP] = 0;
+  event_drul_.set (0, 0);
 }
 
 void
@@ -124,20 +133,25 @@ Text_spanner_engraver::finalize ()
     }
 }
 
-
 void
 Text_spanner_engraver::acknowledge_note_column (Grob_info info)
 {
-  if (span_) {
-    Pointer_group_interface::add_grob (span_,
-                                      ly_symbol2scm ("note-columns"),
-                                      info.grob());
-    add_bound_item (span_, info.grob ());
-  } else if (finished_) {
-    Pointer_group_interface::add_grob (finished_, ly_symbol2scm ("note-columns"),
-                                      info.grob());
-    add_bound_item (finished_, info.grob ());
-  }
+  if (span_)
+    {
+      Pointer_group_interface::add_grob (span_,
+                                        ly_symbol2scm ("note-columns"),
+                                        info.grob ());
+      if (!span_->get_bound (LEFT))
+       add_bound_item (span_, info.grob ());
+    }
+  else if (finished_)
+    {
+      Pointer_group_interface::add_grob (finished_,
+                                        ly_symbol2scm ("note-columns"),
+                                        info.grob ());
+      if (!finished_->get_bound (RIGHT))
+       add_bound_item (finished_, info.grob ());
+    }
 }
 
 ADD_ACKNOWLEDGER (Text_spanner_engraver, note_column);
@@ -150,7 +164,7 @@ ADD_TRANSLATOR (Text_spanner_engraver,
                "TextSpanner ",
 
                /* read */
-               "",
+               "currentMusicalColumn ",
 
                /* write */
                ""