Skip to content

Commit

Permalink
fix #47636 Text in Text-Frames not being seen in parts
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Feb 17, 2015
1 parent 4c18e20 commit db79435
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libmscore/excerpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,13 @@ void cloneStaves(Score* oscore, Score* score, const QList<int>& map)
nmb = new HBox(score);
else if (mb->type() == Element::Type::VBOX)
nmb = new VBox(score);
else if (mb->type() == Element::Type::TBOX)
else if (mb->type() == Element::Type::TBOX) {
nmb = new TBox(score);
Text* text = static_cast<TBox*>(mb)->text();
Element* ne = text->linkedClone();
ne->setScore(score);
nmb->add(ne);
}
else if (mb->type() == Element::Type::MEASURE) {
Measure* m = static_cast<Measure*>(mb);
Measure* nm = new Measure(score);
Expand Down
15 changes: 15 additions & 0 deletions libmscore/textframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,20 @@ void TBox::scanElements(void* data, void (*func)(void*, Element*), bool all)
Box::scanElements(data, func, all);
}

//---------------------------------------------------------
// add
//---------------------------------------------------------

void TBox::add(Element* e)
{
if (e->type() == Element::Type::TEXT) {
delete _text;
e->setParent(this);
_text = static_cast<Text*>(e);
}
else
VBox::add(e);
}

}

1 change: 1 addition & 0 deletions libmscore/textframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class TBox : public VBox {
virtual void layout();
virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true);
Text* text() { return _text; }
virtual void add(Element* e) override;
};


Expand Down

0 comments on commit db79435

Please sign in to comment.