/** \brief Called to break a tag at a previously saved PBreak-Location. It sets the sse-Positions ... (It is somewhat equivalent to StaffFinished, with the difference, that assocpos is used). assocpos is the tail-position of the associated list at the time of the pbreak-situation. Now, this routine is called when a tag needs to be broken because the optimum line break algorithm has determined the breaklocation. */ void GRPositionTag::BreakTag(GRStaff * grstaff, GuidoPos & assocpos) { if (grstaff == 0) return; GRSystemStartEndStruct * sse = getSystemStartEndStruct(grstaff->getGRSystem()); assert(sse); if (error) { setStartElement(grstaff,NULL); setEndElement(grstaff,NULL); lastendElement = NULL; return; } // now we do something ..... NEPointerList * associated = 0; GRNotationElement * el = dynamic_cast<GRNotationElement *>(this); if (el) associated = el->getAssociations(); if (!associated) return; // only, if the startElement is not set and // we do not have an OPENLEFT, the very first // element from the association is made the // startElement. if (sse->startflag == GRSystemStartEndStruct::LEFTMOST && sse->startElement == NULL) { setStartElement(grstaff,associated->GetHead()); sse->startpos = associated->GetHeadPosition(); } // now, we remeber the last end-setting ... lastendElement = sse->endElement; lastendflag = sse->endflag; lastendpos = sse->endpos; // now, we set the new OPENRIGHT and get the // endglue ... // the old association of the end-element MUST // be maintained! -> sse->endElement = NULL; setEndElement(grstaff,grstaff->getEndGlue()); sse->endflag = GRSystemStartEndStruct::OPENRIGHT; // this uses assocpos! sse->endpos = assocpos; sse->grsystem = grstaff->getGRSystem(); // now, we increment the assocpos, so that // we can save this position for // the NEW Segment build with ResumeTag if (associated && assocpos) associated->GetNext(assocpos); // I now have to add a new sse-that handles the next system ? }
/** \brief This removes a whole list of associations */ void GRNotationElement::removeAssociation( const NEPointerList & nl ) { GuidoPos pos = nl.GetHeadPosition(); while (pos) removeAssociation( nl.GetNext(pos)); }