summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-07-26 14:21:02 +0000
committerخالد حسني <khaled@libreoffice.org>2023-07-30 20:44:22 +0200
commit55a0a70e8fd5a76b8d3f49ceed902613025ad6b3 (patch)
tree23d96fa7120b5c5a3d4b9b5459093d2c042e45ec /vcl/unx/generic
parent3d8b7fd32b63370919b6d215be0af6fba6eb4ca4 (diff)
tdf#156230: Drop PDFDevice handling
Change-Id: I53759eb6025a4fc7e1319d0d1e7b3072edde93c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154975 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx22
-rw-r--r--vcl/unx/generic/printer/cpdmgr.cxx2
-rw-r--r--vcl/unx/generic/printer/cupsmgr.cxx2
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx43
-rw-r--r--vcl/unx/generic/printer/printerinfomanager.cxx8
5 files changed, 8 insertions, 69 deletions
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index b217349a6ef4..84de26e1f9cc 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -771,26 +771,11 @@ sal_uInt32 PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, Pr
}
case PrinterCapType::PDF:
- if( PrinterInfoManager::get().checkFeatureToken( pJobSetup->GetPrinterName(), "pdf" ) )
- return 1;
- else
- {
- // see if the PPD contains a value to set PDF device
- JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->GetPrinterName() );
- if( pJobSetup->GetDriverData() )
- JobData::constructFromStreamBuffer( pJobSetup->GetDriverData(), pJobSetup->GetDriverDataLen(), aData );
- return aData.m_nPDFDevice > 0 ? 1 : 0;
- }
+ return 1;
case PrinterCapType::ExternalDialog:
return PrinterInfoManager::get().checkFeatureToken( pJobSetup->GetPrinterName(), "external_dialog" ) ? 1 : 0;
case PrinterCapType::UsePullModel:
- {
- // see if the PPD contains a value to set PDF device
- JobData aData = PrinterInfoManager::get().getPrinterInfo( pJobSetup->GetPrinterName() );
- if( pJobSetup->GetDriverData() )
- JobData::constructFromStreamBuffer( pJobSetup->GetDriverData(), pJobSetup->GetDriverDataLen(), aData );
- return aData.m_nPDFDevice > 0 ? 1 : 0;
- }
+ return 1;
default: break;
}
return 0;
@@ -972,9 +957,6 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
if( i_pSetupData )
JobData::constructFromStreamBuffer( i_pSetupData->GetDriverData(), i_pSetupData->GetDriverDataLen(), m_aJobData );
- OSL_ASSERT( m_aJobData.m_nPDFDevice > 0 );
- m_aJobData.m_nPDFDevice = 1;
-
// possibly create one job for collated output
int nCopies = i_rController.getPrinter()->GetCopyCount();
bool bCollate = i_rController.getPrinter()->IsCollateCopy();
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx
index 851df738fa9c..3955a0235a0a 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -644,7 +644,7 @@ void CPDManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner,
}
}
}
- if( rJob.m_nPDFDevice > 0 && rJob.m_nCopies > 1 )
+ if( rJob.m_nCopies > 1 )
{
OString aVal( OString::number( rJob.m_nCopies ) );
g_variant_builder_add(builder, "(ss)", "copies", aVal.getStr());
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 460dfb50fe47..051023c82255 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -685,7 +685,7 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner
}
}
- if( rJob.m_nPDFDevice > 0 && rJob.m_nCopies > 1 )
+ if( rJob.m_nCopies > 1 )
{
OString aVal( OString::number( rJob.m_nCopies ) );
rNumOptions = cupsAddOption( "copies", aVal.getStr(), rNumOptions, reinterpret_cast<cups_option_t**>(rOptions) );
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 58831593a48c..bb2dded8938e 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -46,7 +46,6 @@ JobData& JobData::operator=(const JobData& rRight)
m_pParser = rRight.m_pParser;
m_aContext = rRight.m_aContext;
m_nPSLevel = rRight.m_nPSLevel;
- m_nPDFDevice = rRight.m_nPDFDevice;
m_nColorDevice = rRight.m_nColorDevice;
if( !m_pParser && !m_aPrinterName.isEmpty() )
@@ -59,29 +58,8 @@ JobData& JobData::operator=(const JobData& rRight)
void JobData::setCollate( bool bCollate )
{
- if (m_nPDFDevice > 0)
- {
- m_bCollate = bCollate;
- return;
- }
- const PPDParser* pParser = m_aContext.getParser();
- if( !pParser )
- return;
-
- const PPDKey* pKey = pParser->getKey( "Collate" );
- if( !pKey )
- return;
-
- const PPDValue* pVal = nullptr;
- if( bCollate )
- pVal = pKey->getValue( "True" );
- else
- {
- pVal = pKey->getValue( "False" );
- if( ! pVal )
- pVal = pKey->getValue( "None" );
- }
- m_aContext.setValue( pKey, pVal );
+ m_bCollate = bCollate;
+ return;
}
void JobData::setPaper( int i_nWidth, int i_nHeight )
@@ -138,11 +116,7 @@ bool JobData::getStreamBuffer( void*& pData, sal_uInt32& bytes )
aLine.setLength(0);
aStream.WriteLine(Concat2View("copies=" + OString::number(static_cast<sal_Int32>(m_nCopies))));
-
- if (m_nPDFDevice > 0)
- {
- aStream.WriteLine(Concat2View("collate=" + OString::boolean(m_bCollate)));
- }
+ aStream.WriteLine(Concat2View("collate=" + OString::boolean(m_bCollate)));
aStream.WriteLine(Concat2View(
"marginadjustment="
@@ -158,8 +132,6 @@ bool JobData::getStreamBuffer( void*& pData, sal_uInt32& bytes )
aStream.WriteLine(Concat2View("pslevel=" + OString::number(static_cast<sal_Int32>(m_nPSLevel))));
- aStream.WriteLine(Concat2View("pdfdevice=" + OString::number(static_cast<sal_Int32>(m_nPDFDevice))));
-
aStream.WriteLine(Concat2View("colordevice=" + OString::number(static_cast<sal_Int32>(m_nColorDevice))));
// now append the PPDContext stream buffer
@@ -190,7 +162,6 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
bool bColorDepth = false;
bool bColorDevice = false;
bool bPSLevel = false;
- bool bPDFDevice = false;
const char printerEquals[] = "printer=";
const char orientatationEquals[] = "orientation=";
@@ -200,7 +171,6 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
const char colordepthEquals[] = "colordepth=";
const char colordeviceEquals[] = "colordevice=";
const char pslevelEquals[] = "pslevel=";
- const char pdfdeviceEquals[] = "pdfdevice=";
while( ! aStream.eof() )
{
@@ -250,11 +220,6 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
bPSLevel = true;
rJobData.m_nPSLevel = o3tl::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(pslevelEquals)));
}
- else if (aLine.startsWith(pdfdeviceEquals))
- {
- bPDFDevice = true;
- rJobData.m_nPDFDevice = o3tl::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(pdfdeviceEquals)));
- }
else if (aLine == "PPDContextData" && bPrinter)
{
PrinterInfoManager& rManager = PrinterInfoManager::get();
@@ -277,7 +242,7 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
}
}
- return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
+ return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bColorDevice && bColorDepth;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index e3afc43a18a2..3957e3608cd2 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -244,10 +244,6 @@ void PrinterInfoManager::initialize()
if (!aValue.isEmpty())
m_aGlobalDefaults.m_nPSLevel = aValue.toInt32();
- aValue = aConfig.ReadKey( "PDFDevice" );
- if (!aValue.isEmpty())
- m_aGlobalDefaults.m_nPDFDevice = aValue.toInt32();
-
// get the PPDContext of global JobData
for( int nKey = 0; nKey < aConfig.GetKeyCount(); ++nKey )
{
@@ -428,10 +424,6 @@ void PrinterInfoManager::initialize()
if (!aValue.isEmpty())
aPrinter.m_aInfo.m_nPSLevel = aValue.toInt32();
- aValue = aConfig.ReadKey( "PDFDevice" );
- if (!aValue.isEmpty())
- aPrinter.m_aInfo.m_nPDFDevice = aValue.toInt32();
-
// now iterate over all keys to extract multi key information:
// 1. PPDContext information
for( int nKey = 0; nKey < aConfig.GetKeyCount(); ++nKey )