int Staff::FillStaffCurrentTimeSpanning(FunctorParams *functorParams) { FillStaffCurrentTimeSpanningParams *params = dynamic_cast<FillStaffCurrentTimeSpanningParams *>(functorParams); assert(params); std::vector<Object *>::iterator iter = params->m_timeSpanningElements.begin(); while (iter != params->m_timeSpanningElements.end()) { TimeSpanningInterface *interface = (*iter)->GetTimeSpanningInterface(); assert(interface); Measure *currentMeasure = dynamic_cast<Measure *>(this->GetFirstParent(MEASURE)); assert(currentMeasure); // We need to make sure we are in the next measure (and not just a staff below because of some cross staff // notation if ((interface->GetStartMeasure() != currentMeasure) && (interface->IsOnStaff(this->GetN()))) { m_timeSpanningElements.push_back(*iter); } iter++; } return FUNCTOR_CONTINUE; }