mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 17:22:04 +00:00
Bug 1660166 part 3: Remove a redundant member-variable that represents the total number of pages. r=hiro
Before this patch stack, nsPageSequenceFrame and every nsPageFrame each individually tracked the number of pages. As of the previous patch, we've coalesced the nsPageFrame variables into a single variable that lives on nsSharedPageData. This patch here replaces nsPageSequenceFrame's member-var with that nsSharedPageData variable, too. Depends on D87696 Differential Revision: https://phabricator.services.mozilla.com/D87697
This commit is contained in:
parent
b39ca4f982
commit
335b4750cb
@ -52,7 +52,6 @@ nsPageSequenceFrame::nsPageSequenceFrame(ComputedStyle* aStyle,
|
||||
: nsContainerFrame(aStyle, aPresContext, kClassID),
|
||||
mMaxSheetSize(mWritingMode),
|
||||
mScrollportSize(mWritingMode),
|
||||
mTotalPages(-1),
|
||||
mCalledBeginPage(false),
|
||||
mCurrentCanvasListSetup(false) {
|
||||
mPageData = MakeUnique<nsSharedPageData>();
|
||||
@ -406,10 +405,8 @@ nsresult nsPageSequenceFrame::StartPrint(nsPresContext* aPresContext,
|
||||
|
||||
// If printing a range of pages make sure at least the starting page
|
||||
// number is valid
|
||||
mTotalPages = mFrames.GetLength();
|
||||
|
||||
if (mDoingPageRange) {
|
||||
if (mFromPageNum > mTotalPages) {
|
||||
if (mFromPageNum > mPageData->mTotNumPages) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,8 @@ class nsSharedPageData {
|
||||
nsString mDocURL;
|
||||
nsFont mHeadFootFont;
|
||||
|
||||
// Total number of pages:
|
||||
// Total number of pages (populated by PrintedSheetFrame when it determines
|
||||
// that it's reflowed the final page):
|
||||
int32_t mTotNumPages = 0;
|
||||
|
||||
// Margin for headers and footers; it defaults to 4/100 of an inch on UNIX
|
||||
@ -90,7 +91,7 @@ class nsPageSequenceFrame final : public nsContainerFrame {
|
||||
nsresult PrintNextPage();
|
||||
void ResetPrintCanvasList();
|
||||
int32_t GetCurrentPageNum() const { return mPageNum; }
|
||||
int32_t GetNumPages() const { return mTotalPages; }
|
||||
int32_t GetNumPages() const { return mPageData->mTotNumPages; }
|
||||
bool IsDoingPrintRange() const { return mDoingPageRange; }
|
||||
void GetPrintRange(int32_t* aFromPage, int32_t* aToPage) const;
|
||||
nsresult DoPageEnd();
|
||||
@ -154,7 +155,6 @@ class nsPageSequenceFrame final : public nsContainerFrame {
|
||||
|
||||
// Async Printing
|
||||
int32_t mPageNum;
|
||||
int32_t mTotalPages;
|
||||
int32_t mFromPageNum;
|
||||
int32_t mToPageNum;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user