mPrintDC->EndDocument();
nsresult rv = mPrintDC->EndDocument(); if (NS_FAILED(rv)) { DocumentViewerImpl::ShowPrintErrorDialog(rv, PR_TRUE); }
PrintData::~PrintData() {  // printing is complete, clean up now  OnEndPrinting(NS_OK); // removes listener  if (mPrintDC) {#ifdef DEBUG_PRINTING    fprintf(mDebugFD, "****************** End Document ************************\n");#endif    mPrintDC->EndDocument();  }  delete mPrintObject;  if (mPrintDocList != nsnull) {    mPrintDocList->Clear();    delete mPrintDocList;  }#ifdef DEBUG_PRINTING  fclose(mDebugFD);#endif  DocumentViewerImpl::mIsDoingPrinting = PR_FALSE;  for (PRInt32 i=0;i<mPrintProgressListeners.Count();i++) {    nsIWebProgressListener* wpl = NS_STATIC_CAST(nsIWebProgressListener*, mPrintProgressListeners.ElementAt(i));    NS_ASSERTION(wpl, "nsIWebProgressListener is NULL!");    NS_RELEASE(wpl);  }}