зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
4751b29785
Коммит
66a1e74908
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче