nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsIPrintSettingsService> printSettingsService = do_GetService(sPrintSettingsServiceContractID, &rv); if (NS_SUCCEEDED(rv)) { rv = printSettingsService->GetGlobalPrintSettings(aGlobalPrintSettings); } return rv;
nsPrintEngine printEngine; return printEngine.GetGlobalPrintSettings(aGlobalPrintSettings); #else return NS_ERROR_FAILURE; #endif
DocumentViewerImpl::GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings){  NS_ENSURE_ARG_POINTER(aGlobalPrintSettings);  nsresult rv = NS_ERROR_FAILURE;  nsCOMPtr<nsIPrintSettingsService> printSettingsService = do_GetService(sPrintSettingsServiceContractID, &rv);  if (NS_SUCCEEDED(rv)) {    rv = printSettingsService->GetGlobalPrintSettings(aGlobalPrintSettings);  }  return rv;}