Kaydet (Commit) 08597f28 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: fdo#44664 spadmin support for forcing "postscript of driver level"

pdf of 0 and ps of 0 == automatically pick pdf if pdf is default backend.
Which means that spadmin wasn't able to disable pdf if one selected
"postscript of driver leve", though picking an explicit postscript level
would work.

So we need to tweak things to use the pdf flag to be either automatic,
explicitly pdf or explicitly ps

Change-Id: Ic5382a3eb9cbcff39d363723825e75851d73520e
üst 13436397
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include "osl/thread.h" #include "osl/thread.h"
#include <officecfg/Office/Common.hxx>
#define LSCAPE_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Landscape" ) ) #define LSCAPE_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Landscape" ) )
#define PORTRAIT_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Portrait" ) ) #define PORTRAIT_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Portrait" ) )
...@@ -381,11 +383,25 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) : ...@@ -381,11 +383,25 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
case 1: m_aSpaceBox.SelectEntry( m_aSpaceColor );break; case 1: m_aSpaceBox.SelectEntry( m_aSpaceColor );break;
} }
sal_uLong nLevelEntryData = 0; sal_uLong nLevelEntryData = 0; //automatic
if( m_pParent->m_aJobData.m_nPDFDevice > 0 ) if( m_pParent->m_aJobData.m_nPDFDevice == 2 ) //explicitly PDF
nLevelEntryData = 10; nLevelEntryData = 10;
else else if (m_pParent->m_aJobData.m_nPSLevel > 0) //explicit PS Level
nLevelEntryData = m_pParent->m_aJobData.m_nPSLevel+1; nLevelEntryData = m_pParent->m_aJobData.m_nPSLevel+1;
else if (m_pParent->m_aJobData.m_nPDFDevice == 1) //automatically PDF
nLevelEntryData = 0;
else if (m_pParent->m_aJobData.m_nPDFDevice == -1) //explicitly PS from driver
nLevelEntryData = 1;
bool bAutoIsPDF = officecfg::Office::Common::Print::Option::Printer::PDFAsStandardPrintJobFormat::get();
assert(nLevelEntryData != 0 || bAutoIsPDF == m_pParent->m_aJobData.m_nPDFDevice);
OUString sStr = m_aLevelBox.GetEntry(0);
m_aLevelBox.InsertEntry(sStr.replaceAll("%s", bAutoIsPDF ? m_aLevelBox.GetEntry(5) : m_aLevelBox.GetEntry(1)), 0);
m_aLevelBox.SetEntryData(0, m_aLevelBox.GetEntryData(1));
m_aLevelBox.RemoveEntry(1);
for( sal_uInt16 i = 0; i < m_aLevelBox.GetEntryCount(); i++ ) for( sal_uInt16 i = 0; i < m_aLevelBox.GetEntryCount(); i++ )
{ {
if( (sal_uLong)m_aLevelBox.GetEntryData( i ) == nLevelEntryData ) if( (sal_uLong)m_aLevelBox.GetEntryData( i ) == nLevelEntryData )
...@@ -435,6 +451,8 @@ void RTSDevicePage::update() ...@@ -435,6 +451,8 @@ void RTSDevicePage::update()
sal_uLong RTSDevicePage::getLevel() sal_uLong RTSDevicePage::getLevel()
{ {
sal_uLong nLevel = (sal_uLong)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() ); sal_uLong nLevel = (sal_uLong)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
if (nLevel == 0)
return 0; //automatic
return nLevel < 10 ? nLevel-1 : 0; return nLevel < 10 ? nLevel-1 : 0;
} }
...@@ -443,7 +461,11 @@ sal_uLong RTSDevicePage::getLevel() ...@@ -443,7 +461,11 @@ sal_uLong RTSDevicePage::getLevel()
sal_uLong RTSDevicePage::getPDFDevice() sal_uLong RTSDevicePage::getPDFDevice()
{ {
sal_uLong nLevel = (sal_uLong)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() ); sal_uLong nLevel = (sal_uLong)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() );
return nLevel > 9 ? 1 : 0; if (nLevel > 9)
return 2; //explictly PDF
else if (nLevel == 0)
return 0; //automatic
return -1; //explicitly PS
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
......
...@@ -186,6 +186,7 @@ TabPage RID_RTS_DEVICEPAGE ...@@ -186,6 +186,7 @@ TabPage RID_RTS_DEVICEPAGE
Size = MAP_APPFONT( 105, 200 ); Size = MAP_APPFONT( 105, 200 );
StringList [en-US] = StringList [en-US] =
{ {
< "Automatic : %s" ; 0; > ;
< "PostScript (Level from driver)" ; 1; > ; < "PostScript (Level from driver)" ; 1; > ;
< "PostScript Level 1" ; 2; > ; < "PostScript Level 1" ; 2; > ;
< "PostScript Level 2"; 3; > ; < "PostScript Level 2"; 3; > ;
......
...@@ -40,9 +40,9 @@ struct VCL_DLLPUBLIC JobData ...@@ -40,9 +40,9 @@ struct VCL_DLLPUBLIC JobData
int m_nBottomMarginAdjust; int m_nBottomMarginAdjust;
// user overrides for PPD // user overrides for PPD
int m_nColorDepth; int m_nColorDepth;
int m_nPSLevel; // 0: no override, else languaglevel to use int m_nPSLevel; // 0: no override, else languagelevel to use
int m_nColorDevice; // 0: no override, -1 grey scale, +1 color int m_nColorDevice; // 0: no override, -1 grey scale, +1 color
int m_nPDFDevice; // 0: PostScript, 1: PDF int m_nPDFDevice; // 0: no override, -1 PostScript, +1: Automatically PDF, +2: Explicitly PDF
orientation::type m_eOrientation; orientation::type m_eOrientation;
::rtl::OUString m_aPrinterName; ::rtl::OUString m_aPrinterName;
const PPDParser* m_pParser; const PPDParser* m_pParser;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment