Skip to content

Commit

Permalink
Merge pull request #6450 from SKefalidis/footer
Browse files Browse the repository at this point in the history
fix #309066 + fix #283996: the same headers/footers are used for the score and all its parts (3.x)
  • Loading branch information
anatoly-os committed Sep 1, 2020
2 parents 43ef1ea + 9221146 commit 43b34fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void MeasureBaseList::change(MeasureBase* ob, MeasureBase* nb)
//---------------------------------------------------------

Score::Score()
: ScoreElement(this), _selection(this), _selectionFilter(this)
: ScoreElement(this), _headersText(MAX_HEADERS, nullptr), _footersText(MAX_FOOTERS, nullptr), _selection(this), _selectionFilter(this)
{
Score::validScores.insert(this);
_masterScore = 0;
Expand Down Expand Up @@ -4983,7 +4983,7 @@ bool Score::isTopScore() const
//---------------------------------------------------------

Movements::Movements()
: std::vector<MasterScore*>(), _headersText(MAX_HEADERS, nullptr), _footersText(MAX_FOOTERS, nullptr)
: std::vector<MasterScore*>()
{
_undo = new UndoStack();
}
Expand Down
17 changes: 7 additions & 10 deletions libmscore/score.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,6 @@ class Movements : public std::vector<MasterScore*> {
UndoStack* _undo;
QList<Page*> _pages; // pages are build from systems
MStyle _style;
std::vector<Text*> _headersText;
std::vector<Text*> _footersText;

public:
Movements();
Expand All @@ -366,10 +364,6 @@ class Movements : public std::vector<MasterScore*> {
UndoStack* undo() const { return _undo; }
MStyle& style() { return _style; }
const MStyle& style() const { return _style; }
std::vector<Text*> headersText() const { return _headersText; }
std::vector<Text*> footersText() const { return _footersText; }
void setHeaderText(Text* t, int index) { _headersText[index] = t; }
void setFooterText(Text* t, int index) { _footersText[index] = t; }
};

//---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -426,6 +420,9 @@ class Score : public QObject, public ScoreElement {
QList<MuseScoreView*> viewer;
Excerpt* _excerpt { 0 };

std::vector<Text*> _headersText;
std::vector<Text*> _footersText;

QString _mscoreVersion;
int _mscoreRevision;

Expand Down Expand Up @@ -1219,10 +1216,10 @@ class Score : public QObject, public ScoreElement {

bool isTopScore() const;

Text* headerText(int index) const { return movements()->headersText()[index]; }
Text* footerText(int index) const { return movements()->footersText()[index]; }
void setHeaderText(Text* t, int index) { movements()->setHeaderText(t, index); }
void setFooterText(Text* t, int index) { movements()->setFooterText(t, index); }
Text* headerText(int index) const { return _headersText[index]; }
Text* footerText(int index) const { return _footersText[index]; }
void setHeaderText(Text* t, int index) { _headersText.at(index) = t; }
void setFooterText(Text* t, int index) { _footersText.at(index) = t; }

void cmdAddPitch(int note, bool addFlag, bool insert);
void forAllLyrics(std::function<void(Lyrics*)> f);
Expand Down

0 comments on commit 43b34fe

Please sign in to comment.