Skip to content

Commit

Permalink
fix #122001 Staff text automatic placement doesnt work, neither in sc…
Browse files Browse the repository at this point in the history
…ore nor in parts
  • Loading branch information
wschweer committed Apr 12, 2018
1 parent 9510ad6 commit a747b2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions libmscore/element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ Element::~Element()
Element* Element::linkedClone()
{
Element* e = clone();
e->setAutoplace(true);
score()->undo(new Link(e, this));
return e;
}
Expand Down
7 changes: 3 additions & 4 deletions libmscore/excerpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ void Excerpt::createExcerpt(Excerpt* excerpt)
score->setPageNumberOffset(oscore->pageNumberOffset());

// Set instruments and create linked staffs
foreach (Part* part, parts) {
for (const Part* part : parts) {
Part* p = new Part(score);
p->setInstrument(*part->instrument());
p->setPartName(part->partName());

foreach (Staff* staff, *part->staves()) {
for (Staff* staff : *part->staves()) {
Staff* s = new Staff(score);
s->setPart(p);
s->setStaffType(0, staff->staffType(0)); // TODO
Expand Down Expand Up @@ -246,7 +246,7 @@ void Excerpt::createExcerpt(Excerpt* excerpt)
interval.flip();

for (auto e : segment->annotations()) {
if ((e->type() != ElementType::HARMONY) || (e->track() < startTrack) || (e->track() >= endTrack))
if (!e->isHarmony() || (e->track() < startTrack) || (e->track() >= endTrack))
continue;
Harmony* h = toHarmony(e);
int rootTpc = Ms::transposeTpc(h->rootTpc(), interval, true);
Expand Down Expand Up @@ -494,7 +494,6 @@ void Excerpt::cloneStaves(Score* oscore, Score* score, const QList<int>& map, QM
QList<int> t = trackList.values(srcTrack);

for (int track : t) {

//Clone KeySig TimeSig and Clefs if voice 1 of source staff is not mapped to a track
Element* oef = oseg->element(srcTrack & ~3);
if (oef && (oef->isTimeSig() || oef->isKeySig()) && oef->tick() == 0
Expand Down
4 changes: 3 additions & 1 deletion libmscore/rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ Rest::Rest(Score* s, const TDuration& d)
Rest::Rest(const Rest& r, bool link)
: ChordRest(r, link)
{
if (link)
if (link) {
score()->undo(new Link(const_cast<Rest*>(&r), this));
setAutoplace(true);
}
_gap = r._gap;
_sym = r._sym;
dotline = r.dotline;
Expand Down

0 comments on commit a747b2b

Please sign in to comment.