зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1486968. Remove nsPrintJob::mOldPrtPreview. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D56205 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
fcd030789b
Коммит
212f106dcf
|
@ -574,7 +574,6 @@ void nsPrintJob::Destroy() {
|
|||
|
||||
#ifdef NS_PRINT_PREVIEW
|
||||
mPrtPreview = nullptr;
|
||||
mOldPrtPreview = nullptr;
|
||||
#endif
|
||||
mDocViewerPrint = nullptr;
|
||||
}
|
||||
|
@ -748,10 +747,6 @@ nsresult nsPrintJob::DoCommonPrint(bool aIsPrintPreview,
|
|||
nsCOMPtr<nsIPrintingPromptService> pps(
|
||||
do_QueryInterface(aWebProgressListener));
|
||||
mProgressDialogIsShown = pps != nullptr;
|
||||
|
||||
if (mIsDoingPrintPreview) {
|
||||
mOldPrtPreview = std::move(mPrtPreview);
|
||||
}
|
||||
} else {
|
||||
mProgressDialogIsShown = false;
|
||||
}
|
||||
|
@ -776,6 +771,11 @@ nsresult nsPrintJob::DoCommonPrint(bool aIsPrintPreview,
|
|||
printData->mPrintSettings->GetShrinkToFit(&printData->mShrinkToFit);
|
||||
|
||||
if (aIsPrintPreview) {
|
||||
// Our new print preview nsPrintData is stored in mPtr until we move it
|
||||
// to mPrtPreview once we've finish creating the print preview. We must
|
||||
// clear mPtrPreview so that code will use mPtr until that happens.
|
||||
mPrtPreview = nullptr;
|
||||
|
||||
mIsCreatingPrintPreview = true;
|
||||
SetIsPrintPreview(true);
|
||||
nsCOMPtr<nsIContentViewer> viewer = do_QueryInterface(mDocViewerPrint);
|
||||
|
@ -2993,10 +2993,6 @@ nsresult nsPrintJob::FinishPrintPreview() {
|
|||
// At this point we are done preparing everything
|
||||
// before it is to be created
|
||||
|
||||
if (mIsDoingPrintPreview && mOldPrtPreview) {
|
||||
mOldPrtPreview = nullptr;
|
||||
}
|
||||
|
||||
printData->OnEndPrinting();
|
||||
// XXX If mPrt becomes nullptr or different instance here, what should we
|
||||
// do?
|
||||
|
|
|
@ -273,9 +273,11 @@ class nsPrintJob final : public nsIObserver,
|
|||
// member-data.
|
||||
RefPtr<nsPrintData> mPrt;
|
||||
|
||||
// Print Preview
|
||||
// The nsPrintData for our last print preview (replaced every time the
|
||||
// user changes settings in the print preview window).
|
||||
// Note: Our new print preview nsPrintData is stored in mPtr until we move it
|
||||
// to mPrtPreview once we've finish creating the print preview.
|
||||
RefPtr<nsPrintData> mPrtPreview;
|
||||
RefPtr<nsPrintData> mOldPrtPreview;
|
||||
|
||||
nsPagePrintTimer* mPagePrintTimer = nullptr;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче