} while (true);
} while (1);
DocumentViewerImpl::CheckForPrinters(nsIPrintOptions*  aPrintOptions,                                     nsIPrintSettings* aPrintSettings,                                     PRUint32          aErrorCode,                                     PRBool            aIsPrinting){  NS_ENSURE_ARG_POINTER(aPrintOptions);  NS_ENSURE_ARG_POINTER(aPrintSettings);  nsresult rv = NS_ERROR_FAILURE;  PRUint32 numPrinters = 0;  nsCOMPtr<nsISimpleEnumerator> simpEnum;  aPrintOptions->AvailablePrinters(getter_AddRefs(simpEnum));  if (simpEnum) {    numPrinters = 0;    do {      PRBool hasMore;      simpEnum->HasMoreElements(&hasMore);      if (!hasMore) break;      nsCOMPtr<nsISupports> supps;      simpEnum->GetNext(getter_AddRefs(supps));      if (numPrinters == 0) {        nsCOMPtr<nsISupportsWString> wStr = do_QueryInterface(supps);        if (wStr) {          PRUnichar* defPrinterName;          wStr->ToString(&defPrinterName);          aPrintSettings->SetPrinterName(defPrinterName);          nsMemory::Free(defPrinterName);        }      }      numPrinters++;    } while (true);    if (numPrinters == 0) {      // this means there were no printers      ShowPrintErrorDialog(aErrorCode, aIsPrinting);    } else {      rv = NS_OK;    }  } else {    // this means there were no printers    // XXX the ifdefs are temporary until they correctly implement Available Printers#if defined(XP_MAC) || defined(XP_OS2)     rv = NS_OK;#else    ShowPrintErrorDialog(aErrorCode, aIsPrinting);#endif  }  return rv;}