diff options
-rw-r--r-- | padmin/source/prtsetup.cxx | 30 | ||||
-rw-r--r-- | padmin/source/rtsetup.src | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/jobdata.hxx | 4 |
3 files changed, 29 insertions, 6 deletions
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx index 936322baa421..3862cde35605 100644 --- a/padmin/source/prtsetup.cxx +++ b/padmin/source/prtsetup.cxx @@ -26,6 +26,8 @@ #include "osl/thread.h" +#include <officecfg/Office/Common.hxx> + #define LSCAPE_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Landscape" ) ) #define PORTRAIT_STRING String( RTL_CONSTASCII_USTRINGPARAM( "Portrait" ) ) @@ -381,11 +383,25 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) : case 1: m_aSpaceBox.SelectEntry( m_aSpaceColor );break; } - sal_uLong nLevelEntryData = 0; - if( m_pParent->m_aJobData.m_nPDFDevice > 0 ) + sal_uLong nLevelEntryData = 0; //automatic + if( m_pParent->m_aJobData.m_nPDFDevice == 2 ) //explicitly PDF nLevelEntryData = 10; - else + else if (m_pParent->m_aJobData.m_nPSLevel > 0) //explicit PS Level 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++ ) { if( (sal_uLong)m_aLevelBox.GetEntryData( i ) == nLevelEntryData ) @@ -435,6 +451,8 @@ void RTSDevicePage::update() sal_uLong RTSDevicePage::getLevel() { sal_uLong nLevel = (sal_uLong)m_aLevelBox.GetEntryData( m_aLevelBox.GetSelectEntryPos() ); + if (nLevel == 0) + return 0; //automatic return nLevel < 10 ? nLevel-1 : 0; } @@ -443,7 +461,11 @@ sal_uLong RTSDevicePage::getLevel() sal_uLong RTSDevicePage::getPDFDevice() { 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 } // ------------------------------------------------------------------ diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src index 0e5e1d3cdfe7..b75a1a32b905 100644 --- a/padmin/source/rtsetup.src +++ b/padmin/source/rtsetup.src @@ -186,6 +186,7 @@ TabPage RID_RTS_DEVICEPAGE Size = MAP_APPFONT( 105, 200 ); StringList [en-US] = { + < "Automatic : %s" ; 0; > ; < "PostScript (Level from driver)" ; 1; > ; < "PostScript Level 1" ; 2; > ; < "PostScript Level 2"; 3; > ; diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx index 5485e018ec15..577e0fadb6a7 100644 --- a/vcl/inc/vcl/jobdata.hxx +++ b/vcl/inc/vcl/jobdata.hxx @@ -40,9 +40,9 @@ struct VCL_DLLPUBLIC JobData int m_nBottomMarginAdjust; // user overrides for PPD 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_nPDFDevice; // 0: PostScript, 1: PDF + int m_nPDFDevice; // 0: no override, -1 PostScript, +1: Automatically PDF, +2: Explicitly PDF orientation::type m_eOrientation; ::rtl::OUString m_aPrinterName; const PPDParser* m_pParser; |