Bug 1660589 - Localize paper names only on macOS and not Linux r=jwatt

Paper names should be localized on macOS, but on linux we want to use
the PWG standardized media name.

Differential Revision: https://phabricator.services.mozilla.com/D87936
This commit is contained in:
Erik Nordin 2020-08-22 01:43:33 +00:00
Родитель 4751b29785
Коммит 66a1e74908
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -94,10 +94,15 @@ void nsPrinterCUPS::GetPrinterName(nsAString& aName) const {
const char* nsPrinterCUPS::LocalizeMediaName(http_t& aConnection,
cups_size_t& aMedia) const {
// We want to localize the name on macOS, but not on Linux.
#ifdef XP_MACOSX
// The returned string is owned by mPrinterInfo.
// https://www.cups.org/doc/cupspm.html#cupsLocalizeDestMedia
return mShim.cupsLocalizeDestMedia(&aConnection, mPrinter, mPrinterInfo,
CUPS_MEDIA_FLAGS_DEFAULT, &aMedia);
#else
return nullptr;
#endif
}
bool nsPrinterCUPS::SupportsDuplex() const {

Просмотреть файл

@ -43,6 +43,7 @@ class nsPrinterCUPS final : public nsPrinterBase {
/**
* Retrieves the localized name for a given media (paper).
* Returns nullptr if the name cannot be localized.
*/
const char* LocalizeMediaName(http_t& aConnection, cups_size_t& aMedia) const;