mPrintDocList->Clear(); DonePrintingPages();
DonePrintingPages(nsnull);
nsresult DocumentViewerImpl::DocumentReadyForPrinting(){  nsresult rv = NS_ERROR_FAILURE;  nsCOMPtr<nsIWebShell> webContainer;  webContainer = do_QueryInterface(mContainer);  if(webContainer) {    //    // Remove ourselves as an image group observer...    //    nsCOMPtr<nsIImageGroup> imageGroup;    mPrintPC->GetImageGroup(getter_AddRefs(imageGroup));    if (imageGroup) {      imageGroup->RemoveObserver(this);    }    // get the focused DOMWindow    nsCOMPtr<nsIDOMWindowInternal> curFocusDOMWin = getter_AddRefs(FindFocusedDOMWindowInternal());    nsCOMPtr<nsIDOMWindow> domWin(do_QueryInterface(curFocusDOMWin));        //    // Send the document to the printer...    //    rv = SetupToPrintContent(webContainer, mPrintDC, domWin);    if (NS_FAILED(rv)) {      // The print job was canceled or there was a problem      // So remove all other documents from the print list      mPrintDocList->Clear();      DonePrintingPages();    }  }  return rv;}