Skip to content

Commit

Permalink
Merge pull request #6054 from mattmcclinch/head-foot-move
Browse files Browse the repository at this point in the history
fix #304957: moving headers/footers causes a crash
  • Loading branch information
anatoly-os committed May 12, 2020
1 parent 29fec5e commit c73d41a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libmscore/page.cpp
Expand Up @@ -155,6 +155,7 @@ void Page::drawHeaderFooter(QPainter* p, int area, const QString& ss) const
text = score()->headerText(area);
if (!text) {
text = new Text(score(), Tid::HEADER);
text->setFlag(ElementFlag::MOVABLE, false);
text->setFlag(ElementFlag::GENERATED, true); // set to disable editing
text->setLayoutToParentWidth(true);
score()->setHeaderText(text, area);
Expand All @@ -164,6 +165,7 @@ void Page::drawHeaderFooter(QPainter* p, int area, const QString& ss) const
text = score()->footerText(area - MAX_HEADERS); // because they are 3 4 5
if (!text) {
text = new Text(score(), Tid::FOOTER);
text->setFlag(ElementFlag::MOVABLE, false);
text->setFlag(ElementFlag::GENERATED, true); // set to disable editing
text->setLayoutToParentWidth(true);
score()->setFooterText(text, area - MAX_HEADERS);
Expand Down

0 comments on commit c73d41a

Please sign in to comment.