diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-28 09:01:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-28 16:52:06 +0200 |
commit | e8493f9349d18cbcb323930a9bf200c542a72d62 (patch) | |
tree | a682aeb0343b0379a2a9d2d9ea39a7f096115050 /vcl/unx/generic | |
parent | ff41cf1b8dbeb36b8824257acb5c5ba272415108 (diff) |
loplugin:collapseif
Change-Id: I69bfafa97c66ef944cc6ae35c7e2f66d0430d6a4
Reviewed-on: https://gerrit.libreoffice.org/76496
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/printer/jobdata.cxx | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index 11f1b931ecaf..e95263e29c49 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -266,26 +266,23 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo bPDFDevice = true; rJobData.m_nPDFDevice = aLine.copy(RTL_CONSTASCII_LENGTH(pdfdeviceEquals)).toInt32(); } - else if (aLine == "PPDContexData") + else if (aLine == "PPDContexData" && bPrinter) { - if( bPrinter ) + PrinterInfoManager& rManager = PrinterInfoManager::get(); + const PrinterInfo& rInfo = rManager.getPrinterInfo( rJobData.m_aPrinterName ); + rJobData.m_pParser = PPDParser::getParser( rInfo.m_aDriverName ); + if( rJobData.m_pParser ) { - PrinterInfoManager& rManager = PrinterInfoManager::get(); - const PrinterInfo& rInfo = rManager.getPrinterInfo( rJobData.m_aPrinterName ); - rJobData.m_pParser = PPDParser::getParser( rInfo.m_aDriverName ); - if( rJobData.m_pParser ) + rJobData.m_aContext.setParser( rJobData.m_pParser ); + sal_uInt64 nBytes = bytes - aStream.Tell(); + std::vector<char> aRemain(nBytes+1); + nBytes = aStream.ReadBytes(aRemain.data(), nBytes); + if (nBytes) { - rJobData.m_aContext.setParser( rJobData.m_pParser ); - sal_uInt64 nBytes = bytes - aStream.Tell(); - std::vector<char> aRemain(nBytes+1); - nBytes = aStream.ReadBytes(aRemain.data(), nBytes); - if (nBytes) - { - aRemain.resize(nBytes+1); - aRemain[nBytes] = 0; - rJobData.m_aContext.rebuildFromStreamBuffer(aRemain); - bContext = true; - } + aRemain.resize(nBytes+1); + aRemain[nBytes] = 0; + rJobData.m_aContext.rebuildFromStreamBuffer(aRemain); + bContext = true; } } } |