Bug 1769717 - Remove nsPrintJob::GetPrintPreviewPresShell(). r=emilio
Long ago we used to play switcheroo with PresShells in order to print a document, but for over a decade we've been cloning the document that is to be printed (bug 487667). Since then we've had no need for this method. Differential Revision: https://phabricator.services.mozilla.com/D146545
This commit is contained in:
@@ -3019,8 +3019,7 @@ nsDocumentViewer::PrintPreviewScrollToPage(int16_t aType, int32_t aPageNum) {
|
||||
if (!GetIsPrintPreview() || mPrintJob->GetIsCreatingPrintPreview())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsIScrollableFrame* sf =
|
||||
mPrintJob->GetPrintPreviewPresShell()->GetRootScrollFrameAsScrollable();
|
||||
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollable();
|
||||
if (!sf) return NS_OK;
|
||||
|
||||
auto [seqFrame, sheetCount] = mPrintJob->GetSeqFrameAndCountSheets();
|
||||
@@ -3094,8 +3093,7 @@ nsDocumentViewer::GetCurrentSheetFrameAndNumber() const {
|
||||
return {nullptr, 0};
|
||||
}
|
||||
|
||||
nsIScrollableFrame* sf =
|
||||
mPrintJob->GetPrintPreviewPresShell()->GetRootScrollFrameAsScrollable();
|
||||
nsIScrollableFrame* sf = mPresShell->GetRootScrollFrameAsScrollable();
|
||||
if (!sf) {
|
||||
// No scrollable contents, returns 1 even if there are multiple sheets.
|
||||
return {seqFrame->PrincipalChildList().FirstChild(), 1};
|
||||
|
||||
@@ -276,10 +276,6 @@ bool nsPrintJob::CheckBeforeDestroy() const {
|
||||
return mPrt && mPrt->mPreparingForPrint;
|
||||
}
|
||||
|
||||
PresShell* nsPrintJob::GetPrintPreviewPresShell() {
|
||||
return mPrtPreview->mPrintObject->mPresShell;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
void nsPrintJob::Destroy() {
|
||||
if (mIsDestroying) {
|
||||
|
||||
@@ -150,7 +150,6 @@ class nsPrintJob final : public nsIWebProgressListener,
|
||||
void FirePrintingErrorEvent(nsresult aPrintError);
|
||||
|
||||
bool CheckBeforeDestroy() const;
|
||||
mozilla::PresShell* GetPrintPreviewPresShell();
|
||||
nsresult Cancel();
|
||||
void Destroy();
|
||||
void DestroyPrintingData();
|
||||
|
||||
Reference in New Issue
Block a user