From eb358d77291eba677141bab113dc27d7aabb0f3e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:44:04 +0200 Subject: Merging upstream version 4:24.2.2. Signed-off-by: Daniel Baumann --- vcl/win/gdi/salprn.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vcl/win') diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 065b060196..aeb3e2b876 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -1215,6 +1215,22 @@ sal_uInt16 WinSalInfoPrinter::GetPaperBinBySourceIndex( const ImplJobSetup* pSet return 0xffff; } +sal_uInt16 WinSalInfoPrinter::GetSourceIndexByPaperBin(const ImplJobSetup* pSetupData, sal_uInt16 nPaperBin) +{ + DWORD nBins = ImplDeviceCaps( this, DC_BINNAMES, nullptr, pSetupData ); + if (nBins != GDI_ERROR) + { + auto pBuffer = std::make_unique(nBins); + DWORD nBins = ImplDeviceCaps( this, DC_BINS, reinterpret_cast(pBuffer.get()), pSetupData ); + if (nBins != GDI_ERROR && nBins > nPaperBin) + { + return *(pBuffer.get() + nPaperBin); + } + } + return 0; +} + + sal_uInt32 WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) { DWORD nRet; -- cgit v1.2.3