]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-column.cc
release: 1.1.0
[lilypond.git] / lily / note-column.cc
index 1085a3c071d3b1e12ce47367f599d9f697278d3b..b00cb5ea0aa7c5fbead811724d1bd26e8d6283ec 100644 (file)
@@ -38,9 +38,15 @@ Interval_t<int>
 Note_column::head_positions_interval() const
 {
   ((Note_column*)this)->sort();
-  return Interval_t<int> (head_l_arr_[0]->position_i_, 
-                         head_l_arr_.top()->position_i_);
+ Interval_t<int>  iv;
+
+ iv.set_empty ();
 
+ if (head_l_arr_.size ())
+   iv = Interval_t<int>(head_l_arr_[0]->position_i_, 
+                         head_l_arr_.top()->position_i_);
+  
+  return iv;
 }
 
 Interval 
@@ -96,18 +102,18 @@ Note_column::do_substitute_dependency (Score_element*o, Score_element*n)
 {
   if (stem_l_ == o) 
     {
-      stem_l_ = n ? (Stem*)n->access_Item ():0;
+      stem_l_ = n ? (Stem*)dynamic_cast <Item *> (n):0;
     }
   if (o->is_type_b (Note_head::static_name ()))
     {
-      head_l_arr_.substitute ((Note_head*)o->access_Item (), 
-                             (n)? (Note_head*)n->access_Item () : 0);
+      head_l_arr_.substitute ((Note_head*)dynamic_cast <Item *> (o), 
+                             (n)? (Note_head*)dynamic_cast <Item *> (n) : 0);
     }
   Script_column::do_substitute_dependency (o,n);
   if (o->is_type_b (Rest::static_name ())) 
     {
-      rest_l_arr_.substitute ((Rest*)o->access_Item (), 
-                             (n)? (Rest*)n->access_Item () : 0);
+      rest_l_arr_.substitute ((Rest*)dynamic_cast <Item *> (o), 
+                             (n)? (Rest*)dynamic_cast <Item *> (n) : 0);
     }
 }