remove unneeded function 'searchSelectedElements'
This commit is contained in:
parent
32d90bfd62
commit
b910b81792
6 changed files with 0 additions and 120 deletions
|
@ -3040,17 +3040,6 @@ void Score::lassoSelectEnd()
|
|||
_updateAll = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// searchSelectedElements
|
||||
// "ElementList selected"
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Score::searchSelectedElements()
|
||||
{
|
||||
_selection.searchSelectedElements();
|
||||
_selectionChanged = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// addLyrics
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -530,8 +530,6 @@ class Score : public QObject {
|
|||
ChordRest* addClone(ChordRest* cr, int tick, const TDuration& d);
|
||||
Rest* setRest(int tick, int track, Fraction, bool useDots, Tuplet* tuplet);
|
||||
|
||||
void searchSelectedElements();
|
||||
|
||||
void upDown(bool up, UpDownMode);
|
||||
ChordRest* searchNote(int tick, int track) const;
|
||||
|
||||
|
|
|
@ -955,79 +955,8 @@ bool Score::read(XmlReader& e)
|
|||
e.unknown();
|
||||
}
|
||||
|
||||
// check slurs
|
||||
#if 0 // TODO-S
|
||||
foreach(Spanner* s, e.spanner()) {
|
||||
if (!s->startElement() || !s->endElement()) {
|
||||
qDebug("remove incomplete Spanner %s", s->name());
|
||||
switch (s->anchor()) {
|
||||
case Spanner::ANCHOR_SEGMENT: {
|
||||
if (s->startElement()) {
|
||||
Segment* seg = static_cast<Segment*>(s->startElement());
|
||||
seg->removeSpannerFor(s);
|
||||
}
|
||||
if (s->endElement()) {
|
||||
Segment* seg = static_cast<Segment*>(s->endElement());
|
||||
seg->removeSpannerBack(s);
|
||||
}
|
||||
Segment* seg = static_cast<Segment*>(s->parent());
|
||||
if (seg->isEmpty())
|
||||
seg->measure()->remove(seg);
|
||||
delete s;
|
||||
}
|
||||
break;
|
||||
case Spanner::ANCHOR_CHORD:
|
||||
if (s->startElement()) {
|
||||
ChordRest* cr = static_cast<ChordRest*>(s->startElement());
|
||||
cr->removeSpannerFor(s);
|
||||
}
|
||||
if (s->endElement()) {
|
||||
ChordRest* cr = static_cast<ChordRest*>(s->endElement());
|
||||
cr->removeSpannerBack(s);
|
||||
}
|
||||
e.removeSpanner(s);
|
||||
delete s;
|
||||
break;
|
||||
|
||||
case Spanner::ANCHOR_NOTE:
|
||||
case Spanner::ANCHOR_MEASURE:
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (s->type() != Element::SLUR)
|
||||
continue;
|
||||
|
||||
Slur* slur = static_cast<Slur*>(s);
|
||||
|
||||
ChordRest* cr1 = (ChordRest*)(slur->startElement());
|
||||
ChordRest* cr2 = (ChordRest*)(slur->endElement());
|
||||
if (cr1->tick() > cr2->tick()) {
|
||||
qDebug("Slur invalid start-end tick %d-%d\n", cr1->tick(), cr2->tick());
|
||||
slur->setStartElement(cr2);
|
||||
slur->setEndElement(cr1);
|
||||
}
|
||||
#if 1 // DEBUG
|
||||
int n1 = 0;
|
||||
int n2 = 0;
|
||||
for (Spanner* s = cr1->spannerFor(); s; s = s->next()) {
|
||||
if (s == slur)
|
||||
++n1;
|
||||
}
|
||||
for (Spanner* s = cr2->spannerBack(); s; s = s->next()) {
|
||||
if (s == slur)
|
||||
++n2;
|
||||
}
|
||||
if (n1 != 1 || n2 != 1)
|
||||
qDebug("Slur references bad: %d %d", n1, n2);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
connectTies();
|
||||
|
||||
searchSelectedElements();
|
||||
|
||||
_fileDivision = MScore::division;
|
||||
|
||||
//
|
||||
|
|
|
@ -356,38 +356,6 @@ void Selection::setRange(Segment* a, Segment* b, int c, int d)
|
|||
setState(SEL_RANGE);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// searchSelectedElements
|
||||
// "ElementList selected"
|
||||
//---------------------------------------------------------
|
||||
|
||||
/**
|
||||
Rebuild list of selected Elements.
|
||||
*/
|
||||
static void collectSelectedElements(void* data, Element* e)
|
||||
{
|
||||
QList<const Element*>* l = static_cast<QList<const Element*>*>(data);
|
||||
if (e->selected())
|
||||
l->append(e);
|
||||
}
|
||||
|
||||
void Selection::searchSelectedElements()
|
||||
{
|
||||
_el.clear();
|
||||
_score->scanElements(&_el, collectSelectedElements, true);
|
||||
updateState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// reconstructElementList
|
||||
/// reconstruct list of selected elements after undo/redo
|
||||
//---------------------------------------------------------
|
||||
|
||||
void Selection::reconstructElementList()
|
||||
{
|
||||
searchSelectedElements();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
// update
|
||||
/// Set select flag for all Elements in select list.
|
||||
|
|
|
@ -77,7 +77,6 @@ class Selection {
|
|||
SelState state() const { return _state; }
|
||||
void setState(SelState s);
|
||||
|
||||
void searchSelectedElements();
|
||||
const QList<Element*>& elements() const { return _el; }
|
||||
bool isSingle() const { return (_state == SEL_LIST) && (_el.size() == 1); }
|
||||
QList<Note*> noteList(int track = -1) const;
|
||||
|
@ -114,7 +113,6 @@ class Selection {
|
|||
void setStaffEnd(int v) { _staffEnd = v; }
|
||||
void setActiveTrack(int v) { _activeTrack = v; }
|
||||
bool canCopy() const;
|
||||
void reconstructElementList();
|
||||
void updateSelectedElements();
|
||||
bool measureRange(Measure** m1, Measure** m2) const;
|
||||
};
|
||||
|
|
|
@ -324,7 +324,6 @@ void SaveState::undo()
|
|||
redoInputState = score->inputState();
|
||||
redoSelection = score->selection();
|
||||
score->setInputState(undoInputState);
|
||||
// undoSelection.reconstructElementList();
|
||||
score->setSelection(undoSelection);
|
||||
}
|
||||
|
||||
|
@ -334,7 +333,6 @@ void SaveState::redo()
|
|||
undoSelection = score->selection();
|
||||
score->setInputState(redoInputState);
|
||||
score->setSelection(redoSelection);
|
||||
// score->selection().reconstructElementList();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue