Bug 1287446 - Check and add nsIPrintProgressParams and print progress listener separately in nsPrintEngine::ShowPrintProgress. r=tnikkel, a=gchang
authorBob Owen <bobowencode@gmail.com>
Wed, 03 Aug 2016 09:50:24 +0100
changeset 332619 6711a01f35ad9aacde76a34efc3e522a4db33dab
parent 332618 bd7ac9bc5d7b8285929c956025ee6bd30221fea6
child 332620 ce57d7b45b4ab257bbd8534951aba765053ad463
push id9880
push usercbook@mozilla.com
push dateMon, 08 Aug 2016 07:02:11 +0000
treeherdermozilla-aurora@ced4606c4ef5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel, gchang
bugs1287446
milestone50.0a2
Bug 1287446 - Check and add nsIPrintProgressParams and print progress listener separately in nsPrintEngine::ShowPrintProgress. r=tnikkel, a=gchang MozReview-Commit-ID: GngheT4Mizd
layout/printing/nsPrintEngine.cpp
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -1067,18 +1067,21 @@ nsPrintEngine::ShowPrintProgress(bool aI
       nsCOMPtr<nsIWebProgressListener> printProgressListener;
 
       nsCOMPtr<nsIWebBrowserPrint> wbp(do_QueryInterface(mDocViewerPrint));
       nsresult rv = printPromptService->ShowProgress(domWin, wbp, mPrt->mPrintSettings, this, aIsForPrinting,
                                                      getter_AddRefs(printProgressListener), 
                                                      getter_AddRefs(mPrt->mPrintProgressParams), 
                                                      &aDoNotify);
       if (NS_SUCCEEDED(rv)) {
-        if (printProgressListener && mPrt->mPrintProgressParams) {
+        if (printProgressListener) {
           mPrt->mPrintProgressListeners.AppendObject(printProgressListener);
+        }
+
+        if (mPrt->mPrintProgressParams) {
           SetDocAndURLIntoProgress(mPrt->mPrintObject, mPrt->mPrintProgressParams);
         }
       }
     }
   }
 }
 
 //---------------------------------------------------------------------