Skip to content

Commit

Permalink
fix #29096
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Aug 7, 2014
1 parent 760490f commit 0f756f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 6 additions & 3 deletions libmscore/instrument.cpp
Expand Up @@ -176,10 +176,11 @@ void InstrumentData::write(Xml& xml) const
xml.tag("useDrumset", _useDrumset);
_drumset->save(xml);
}

if (_clefType._concertClef == _clefType._transposingClef) {
QString tag = ClefInfo::tag(_clefType._concertClef);
xml.tag("clef", tag);
if (_clefType._concertClef != ClefType::G) {
QString tag = ClefInfo::tag(_clefType._concertClef);
xml.tag("clef", tag);
}
}
else {
QString tag1 = ClefInfo::tag(_clefType._concertClef);
Expand Down Expand Up @@ -213,6 +214,8 @@ void InstrumentData::read(XmlReader& e)
int pan = 60;
bool customDrumset = false;

_clefType._concertClef = ClefType::G;
_clefType._transposingClef = ClefType::G;
_channel.clear();
while (e.readNextStartElement()) {
const QStringRef& tag(e.name());
Expand Down
11 changes: 5 additions & 6 deletions libmscore/undo.cpp
Expand Up @@ -1063,7 +1063,6 @@ void Score::undoAddElement(Element* element)
}
}
}

undo(new AddElement(nsp));
}
else if (element->type() == Element::Type::TREMOLO && static_cast<Tremolo*>(element)->twoNotes()) {
Expand Down Expand Up @@ -1434,24 +1433,24 @@ RemoveElement::RemoveElement(Element* e)
}
}
for (auto s : sl)
score->undoRemoveElement(s);
score->undo(new RemoveElement(s));
}
ChordRest* cr = static_cast<ChordRest*>(element);
if (cr->tuplet() && cr->tuplet()->elements().empty())
score->undoRemoveElement(cr->tuplet());
score->undo(new RemoveElement(cr->tuplet()));
if (e->type() == Element::Type::CHORD) {
Chord* chord = static_cast<Chord*>(e);
// remove tremolo between 2 notes
if (chord->tremolo()) {
Tremolo* tremolo = chord->tremolo();
if (tremolo->twoNotes())
score->undoRemoveElement(tremolo);
score->undo(new RemoveElement(tremolo));
}
for (const Note* note : chord->notes()) {
if (note->tieFor() && note->tieFor()->endNote())
score->undoRemoveElement(note->tieFor());
score->undo(new RemoveElement(note->tieFor()));
if (note->tieBack())
score->undoRemoveElement(note->tieBack());
score->undo(new RemoveElement(note->tieBack()));
}
}
}
Expand Down

0 comments on commit 0f756f2

Please sign in to comment.