diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:27:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:27:30 +0000 |
commit | a2baea7faff31d26459dab3668a39eae85e4991b (patch) | |
tree | eaa2048ce9c715481f932dcfe20368e252b77d2f /vcl/win/gdi | |
parent | Adding upstream version 4:24.2.0. (diff) | |
download | libreoffice-58b4fd97d4526c3e8a75ace3a6be15d2f53c6dcf.tar.xz libreoffice-58b4fd97d4526c3e8a75ace3a6be15d2f53c6dcf.zip |
Adding upstream version 4:24.2.1.upstream/4%24.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vcl/win/gdi')
-rw-r--r-- | vcl/win/gdi/salprn.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 3302efa2d9..065b060196 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -1196,6 +1196,25 @@ OUString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal return aPaperBinName; } +sal_uInt16 WinSalInfoPrinter::GetPaperBinBySourceIndex( const ImplJobSetup* pSetupData, sal_uInt16 nPaperSource ) +{ + DWORD nBins = ImplDeviceCaps( this, DC_BINNAMES, nullptr, pSetupData ); + if (nBins != GDI_ERROR) + { + auto pBuffer = std::make_unique<sal_uInt16[]>(nBins); + DWORD nBins = ImplDeviceCaps( this, DC_BINS, reinterpret_cast<BYTE*>(pBuffer.get()), pSetupData ); + if (nBins != GDI_ERROR) + { + for (DWORD nBin = 0; nBin < nBins; ++nBin) + { + if (nPaperSource == *(pBuffer.get() + nBin)) + return nBin; + } + } + } + return 0xffff; +} + sal_uInt32 WinSalInfoPrinter::GetCapabilities( const ImplJobSetup* pSetupData, PrinterCapType nType ) { DWORD nRet; |