diff --git a/layout/generic/PrintedSheetFrame.cpp b/layout/generic/PrintedSheetFrame.cpp index 1d338139e82f..a4576500991d 100644 --- a/layout/generic/PrintedSheetFrame.cpp +++ b/layout/generic/PrintedSheetFrame.cpp @@ -98,7 +98,7 @@ void PrintedSheetFrame::Reflow(nsPresContext* aPresContext, if (status.IsFullyComplete()) { // The page we just reflowed is the final page! Record its page number // as the number of pages: - mPD->mTotNumPages = pageFrame->GetPageNum(); + mPD->mRawNumPages = pageFrame->GetPageNum(); // Normally, we (the parent frame) would be responsible for deleting the // next-in-flow of our fully-complete children. But since we don't diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 5167ce84236f..43bff73a32c6 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -208,7 +208,7 @@ void nsPageFrame::ProcessSpecialCodes(const nsString& aStr, nsString& aNewStr) { if (aStr.Find(kPageAndTotal) != kNotFound) { nsAutoString uStr; nsTextFormatter::ssprintf(uStr, mPD->mPageNumAndTotalsFormat.get(), - mPageNum, mPD->mTotNumPages); + mPageNum, mPD->mRawNumPages); aNewStr.ReplaceSubstring(kPageAndTotal, uStr); } @@ -235,7 +235,7 @@ void nsPageFrame::ProcessSpecialCodes(const nsString& aStr, nsString& aNewStr) { if (aStr.Find(kPageTotal) != kNotFound) { nsAutoString uStr; nsTextFormatter::ssprintf(uStr, mPD->mPageNumFormat.get(), - mPD->mTotNumPages); + mPD->mRawNumPages); aNewStr.ReplaceSubstring(kPageTotal, uStr); } } diff --git a/layout/generic/nsPageSequenceFrame.cpp b/layout/generic/nsPageSequenceFrame.cpp index a716504a1afa..b0434691425d 100644 --- a/layout/generic/nsPageSequenceFrame.cpp +++ b/layout/generic/nsPageSequenceFrame.cpp @@ -406,7 +406,7 @@ nsresult nsPageSequenceFrame::StartPrint(nsPresContext* aPresContext, // If printing a range of pages make sure at least the starting page // number is valid if (mDoingPageRange) { - if (mFromPageNum > mPageData->mTotNumPages) { + if (mFromPageNum > mPageData->mRawNumPages) { return NS_ERROR_INVALID_ARG; } } diff --git a/layout/generic/nsPageSequenceFrame.h b/layout/generic/nsPageSequenceFrame.h index 1f49b758f1e8..f210d37c8d03 100644 --- a/layout/generic/nsPageSequenceFrame.h +++ b/layout/generic/nsPageSequenceFrame.h @@ -38,8 +38,7 @@ class nsSharedPageData { // Total number of pages (populated by PrintedSheetFrame when it determines // that it's reflowed the final page): - // XXXdholbert The next patch in this series will rename this to mRawNumPages. - int32_t mTotNumPages = 0; + int32_t mRawNumPages = 0; // Margin for headers and footers; it defaults to 4/100 of an inch on UNIX // and 0 elsewhere; I think it has to do with some inconsistency in page size @@ -89,7 +88,7 @@ class nsPageSequenceFrame final : public nsContainerFrame { nsresult PrintNextPage(); void ResetPrintCanvasList(); int32_t GetCurrentPageNum() const { return mPageNum; } - int32_t GetRawNumPages() const { return mPageData->mTotNumPages; } + int32_t GetRawNumPages() const { return mPageData->mRawNumPages; } bool IsDoingPrintRange() const { return mDoingPageRange; } void GetPrintRange(int32_t* aFromPage, int32_t* aToPage) const; nsresult DoPageEnd();