Skip to content

Commit

Permalink
fix 45946: page numbering in export parts as PDF
Browse files Browse the repository at this point in the history
for *-Score_and_Parts.pdf, to be the same as if score and parts had been
generated separatly.
  • Loading branch information
Jojo-Schmitz committed May 8, 2015
1 parent 5b6da6a commit 656170b
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions mscore/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1926,13 +1926,6 @@ bool MuseScore::savePdf(QList<Score*> cs, const QString& saveName)
double mag = printerDev.logicalDpiX() / MScore::DPI;
p.scale(mag, mag);

//
// start pageOffset with configured offset of
// first score
//
int pageOffset = 0;
if (firstScore)
pageOffset = firstScore->pageNumberOffset();
bool firstPage = true;
for (Score* s : cs) {
LayoutMode layoutMode = s->layoutMode();
Expand All @@ -1942,10 +1935,7 @@ bool MuseScore::savePdf(QList<Score*> cs, const QString& saveName)
s->doLayout();
}
s->setPrinting(true);
//
// here we ignore the configured page offset
//
int oldPageOffset = s->pageNumberOffset();
int pageOffset = s->pageNumberOffset();
s->setPageNumberOffset(pageOffset);
bool oldFirstPageNumber = s->style(StyleIdx::footerFirstPage).toBool();
s->style()->set(StyleIdx::footerFirstPage, true);
Expand All @@ -1962,11 +1952,9 @@ bool MuseScore::savePdf(QList<Score*> cs, const QString& saveName)
firstPage = false;
s->print(&p, n);
}
pageOffset += pages;

//reset score
s->setPrinting(false);
s->setPageNumberOffset(oldPageOffset);
s->style()->set(StyleIdx::footerFirstPage, oldFirstPageNumber);
s->doLayout();
if (layoutMode != s->layoutMode())
Expand Down

1 comment on commit 656170b

@Jojo-Schmitz
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to get redone, conflicts with 64780e9

Please sign in to comment.