summaryrefslogtreecommitdiffstats
path: root/vcl/win/gdi
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
commita2baea7faff31d26459dab3668a39eae85e4991b (patch)
treeeaa2048ce9c715481f932dcfe20368e252b77d2f /vcl/win/gdi
parentAdding upstream version 4:24.2.0. (diff)
downloadlibreoffice-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.cxx19
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;