[Libreoffice-commits] .: 3 commits - padmin/source svtools/inc unotools/inc vcl/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 30 06:11:51 PST 2012


 padmin/source/prtsetup.cxx                        |   30 +++++++++++++++++++---
 padmin/source/rtsetup.src                         |    1 
 svtools/inc/svtools/menuoptions.hxx               |    2 -
 unotools/inc/unotools/cmdoptions.hxx              |    2 -
 unotools/inc/unotools/defaultoptions.hxx          |    2 -
 unotools/inc/unotools/dynamicmenuoptions.hxx      |    2 -
 unotools/inc/unotools/extendedsecurityoptions.hxx |    2 -
 unotools/inc/unotools/fontoptions.hxx             |    2 -
 unotools/inc/unotools/historyoptions.hxx          |    2 -
 unotools/inc/unotools/internaloptions.hxx         |    2 -
 unotools/inc/unotools/localisationoptions.hxx     |    2 -
 unotools/inc/unotools/moduleoptions.hxx           |    2 -
 unotools/inc/unotools/options.hxx                 |    3 +-
 unotools/inc/unotools/optionsdlg.hxx              |    2 -
 unotools/inc/unotools/pathoptions.hxx             |    2 -
 unotools/inc/unotools/printwarningoptions.hxx     |    2 -
 unotools/inc/unotools/securityoptions.hxx         |    2 -
 unotools/inc/unotools/syslocaleoptions.hxx        |    2 -
 unotools/inc/unotools/useroptions.hxx             |    2 -
 unotools/inc/unotools/viewoptions.hxx             |    2 -
 unotools/inc/unotools/workingsetoptions.hxx       |    2 -
 vcl/inc/vcl/jobdata.hxx                           |    4 +-
 vcl/inc/vcl/lstbox.hxx                            |    1 
 23 files changed, 49 insertions(+), 26 deletions(-)

New commits:
commit 08597f2897e5ac752147c8f2c4a91bb557ed4580
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 30 14:04:12 2012 +0000

    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

diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 936322b..3862cde 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 0e5e1d3..b75a1a3 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 5485e01..577e0fa 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;
commit 13436397d2494505d68d8dacc98d2c49ba4f3b36
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 30 13:56:03 2012 +0000

    SetTopEntryStr declared but never defined
    
    Change-Id: Icfca11faebceab2dbb1dd065f0569203159b4ee9

diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx
index 8a768d1..a3a7dbb 100644
--- a/vcl/inc/vcl/lstbox.hxx
+++ b/vcl/inc/vcl/lstbox.hxx
@@ -155,7 +155,6 @@ public:
     long            GetEntryFlags( sal_uInt16 nPos ) const;
 
     void            SetTopEntry( sal_uInt16 nPos );
-    void            SetTopEntryStr( const XubString& rStr );
     sal_uInt16          GetTopEntry() const;
 
     void            SaveValue() { mnSaveValue = GetSelectEntryPos(); }
commit df46204c5cd3b3209709b537348b4532cc6c9bc4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 30 09:36:49 2012 +0000

    shake out unused option instances
    
    Change-Id: I2a7ac1ed79455f28f2ba2043b9183a77c63e68ab

diff --git a/svtools/inc/svtools/menuoptions.hxx b/svtools/inc/svtools/menuoptions.hxx
index 387e74e..fa99dbf 100644
--- a/svtools/inc/svtools/menuoptions.hxx
+++ b/svtools/inc/svtools/menuoptions.hxx
@@ -44,7 +44,7 @@ class SvtMenuOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class SVT_DLLPUBLIC SvtMenuOptions: public utl::detail::Options
+class SVT_DLLPUBLIC SAL_WARN_UNUSED SvtMenuOptions: public utl::detail::Options
 {
     public:
 
diff --git a/unotools/inc/unotools/cmdoptions.hxx b/unotools/inc/unotools/cmdoptions.hxx
index b925704..b24635f 100644
--- a/unotools/inc/unotools/cmdoptions.hxx
+++ b/unotools/inc/unotools/cmdoptions.hxx
@@ -51,7 +51,7 @@ class SvtCommandOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtCommandOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtCommandOptions : public utl::detail::Options
 {
     friend class SvtCommandOptions_Impl;
 
diff --git a/unotools/inc/unotools/defaultoptions.hxx b/unotools/inc/unotools/defaultoptions.hxx
index 5c529b1..175fd32 100644
--- a/unotools/inc/unotools/defaultoptions.hxx
+++ b/unotools/inc/unotools/defaultoptions.hxx
@@ -29,7 +29,7 @@ class SvtDefaultOptions_Impl;
 // class SvtDefaultOptions -----------------------------------------------
 
 class SvtDefaultOptions_Impl;
-class UNOTOOLS_DLLPUBLIC SvtDefaultOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtDefaultOptions : public utl::detail::Options
 {
 private:
     SvtDefaultOptions_Impl* pImp;
diff --git a/unotools/inc/unotools/dynamicmenuoptions.hxx b/unotools/inc/unotools/dynamicmenuoptions.hxx
index cf41e12..8c29bf7 100644
--- a/unotools/inc/unotools/dynamicmenuoptions.hxx
+++ b/unotools/inc/unotools/dynamicmenuoptions.hxx
@@ -64,7 +64,7 @@ class SvtDynamicMenuOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtDynamicMenuOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtDynamicMenuOptions : public utl::detail::Options
 {
     public:
         /*-****************************************************************************************************//**
diff --git a/unotools/inc/unotools/extendedsecurityoptions.hxx b/unotools/inc/unotools/extendedsecurityoptions.hxx
index 43815aa..5215051 100644
--- a/unotools/inc/unotools/extendedsecurityoptions.hxx
+++ b/unotools/inc/unotools/extendedsecurityoptions.hxx
@@ -47,7 +47,7 @@ class SvtExtendedSecurityOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtExtendedSecurityOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtExtendedSecurityOptions : public utl::detail::Options
 {
     public:
         // Must be zero based!
diff --git a/unotools/inc/unotools/fontoptions.hxx b/unotools/inc/unotools/fontoptions.hxx
index fa1f16f..333a481 100644
--- a/unotools/inc/unotools/fontoptions.hxx
+++ b/unotools/inc/unotools/fontoptions.hxx
@@ -44,7 +44,7 @@ class SvtFontOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtFontOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtFontOptions : public utl::detail::Options
 {
     public:
         /*-****************************************************************************************************//**
diff --git a/unotools/inc/unotools/historyoptions.hxx b/unotools/inc/unotools/historyoptions.hxx
index fbc3611..425aa90 100644
--- a/unotools/inc/unotools/historyoptions.hxx
+++ b/unotools/inc/unotools/historyoptions.hxx
@@ -67,7 +67,7 @@ class SvtHistoryOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtHistoryOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SvtHistoryOptions SAL_WARN_UNUSED : public utl::detail::Options
 {
     public:
         /*-****************************************************************************************************//**
diff --git a/unotools/inc/unotools/internaloptions.hxx b/unotools/inc/unotools/internaloptions.hxx
index 666e3af..49db685 100644
--- a/unotools/inc/unotools/internaloptions.hxx
+++ b/unotools/inc/unotools/internaloptions.hxx
@@ -48,7 +48,7 @@ class SvtInternalOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtInternalOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtInternalOptions : public utl::detail::Options
 {
     public:
 
diff --git a/unotools/inc/unotools/localisationoptions.hxx b/unotools/inc/unotools/localisationoptions.hxx
index dba9f45..93f5d1f 100644
--- a/unotools/inc/unotools/localisationoptions.hxx
+++ b/unotools/inc/unotools/localisationoptions.hxx
@@ -43,7 +43,7 @@ class SvtLocalisationOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtLocalisationOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtLocalisationOptions : public utl::detail::Options
 {
     public:
         /*-****************************************************************************************************//**
diff --git a/unotools/inc/unotools/moduleoptions.hxx b/unotools/inc/unotools/moduleoptions.hxx
index e382c2c..fed7fa9 100644
--- a/unotools/inc/unotools/moduleoptions.hxx
+++ b/unotools/inc/unotools/moduleoptions.hxx
@@ -58,7 +58,7 @@ class SvtModuleOptions_Impl;
     @devstatus      ready to use
     @threadsafe     yes
 *//*-*************************************************************************************************************/
-class UNOTOOLS_DLLPUBLIC SvtModuleOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtModuleOptions : public utl::detail::Options
 {
     public:
 
diff --git a/unotools/inc/unotools/options.hxx b/unotools/inc/unotools/options.hxx
index aabb9cc..5a37b02 100644
--- a/unotools/inc/unotools/options.hxx
+++ b/unotools/inc/unotools/options.hxx
@@ -72,7 +72,8 @@ namespace detail {
 // shared between unotools, svl and svt)
 // It also provides an implementation for a Configuration Listener and inherits a broadcaster implementation
 
-class UNOTOOLS_DLLPUBLIC Options : public utl::ConfigurationBroadcaster, public utl::ConfigurationListener
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED Options
+    : public utl::ConfigurationBroadcaster, public utl::ConfigurationListener
 {
 public:
     Options();
diff --git a/unotools/inc/unotools/optionsdlg.hxx b/unotools/inc/unotools/optionsdlg.hxx
index d4fc683..8682183 100644
--- a/unotools/inc/unotools/optionsdlg.hxx
+++ b/unotools/inc/unotools/optionsdlg.hxx
@@ -25,7 +25,7 @@
 
 class SvtOptionsDlgOptions_Impl;
 
-class UNOTOOLS_DLLPUBLIC SvtOptionsDialogOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtOptionsDialogOptions : public utl::detail::Options
 {
 private:
     SvtOptionsDlgOptions_Impl* m_pImp;
diff --git a/unotools/inc/unotools/pathoptions.hxx b/unotools/inc/unotools/pathoptions.hxx
index 4447ea3..680a196 100644
--- a/unotools/inc/unotools/pathoptions.hxx
+++ b/unotools/inc/unotools/pathoptions.hxx
@@ -29,7 +29,7 @@
 // class SvtPathOptions --------------------------------------------------
 
 class SvtPathOptions_Impl;
-class UNOTOOLS_DLLPUBLIC SvtPathOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtPathOptions : public utl::detail::Options
 {
 private:
     SvtPathOptions_Impl*    pImp;
diff --git a/unotools/inc/unotools/printwarningoptions.hxx b/unotools/inc/unotools/printwarningoptions.hxx
index 745ce72..327cf8d 100644
--- a/unotools/inc/unotools/printwarningoptions.hxx
+++ b/unotools/inc/unotools/printwarningoptions.hxx
@@ -45,7 +45,7 @@ class SvtPrintWarningOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtPrintWarningOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtPrintWarningOptions : public utl::detail::Options
 {
     public:
         /*-****************************************************************************************************//**
diff --git a/unotools/inc/unotools/securityoptions.hxx b/unotools/inc/unotools/securityoptions.hxx
index 05d9194..9676c30 100644
--- a/unotools/inc/unotools/securityoptions.hxx
+++ b/unotools/inc/unotools/securityoptions.hxx
@@ -59,7 +59,7 @@ enum EBasicSecurityMode
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtSecurityOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtSecurityOptions : public utl::detail::Options
 {
     public:
 
diff --git a/unotools/inc/unotools/syslocaleoptions.hxx b/unotools/inc/unotools/syslocaleoptions.hxx
index d9bb17e..546682b 100644
--- a/unotools/inc/unotools/syslocaleoptions.hxx
+++ b/unotools/inc/unotools/syslocaleoptions.hxx
@@ -42,7 +42,7 @@ class SvtSysLocaleOptions_Impl;
 class SvtListener;
 namespace osl { class Mutex; }
 
-class UNOTOOLS_DLLPUBLIC SvtSysLocaleOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtSysLocaleOptions : public utl::detail::Options
 {
     static  SvtSysLocaleOptions_Impl*   pOptions;
     static  sal_Int32                   nRefCount;
diff --git a/unotools/inc/unotools/useroptions.hxx b/unotools/inc/unotools/useroptions.hxx
index a7b2267..f3752c5 100644
--- a/unotools/inc/unotools/useroptions.hxx
+++ b/unotools/inc/unotools/useroptions.hxx
@@ -49,7 +49,7 @@
 
 // class SvtUserOptions --------------------------------------------------
 
-class UNOTOOLS_DLLPUBLIC SvtUserOptions : public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtUserOptions : public utl::detail::Options
 {
 public:
     SvtUserOptions ();
diff --git a/unotools/inc/unotools/viewoptions.hxx b/unotools/inc/unotools/viewoptions.hxx
index 8270ed9..0fa54f2 100644
--- a/unotools/inc/unotools/viewoptions.hxx
+++ b/unotools/inc/unotools/viewoptions.hxx
@@ -103,7 +103,7 @@ enum EViewType
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class UNOTOOLS_DLLPUBLIC SvtViewOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtViewOptions : public utl::detail::Options
 {
     //-------------------------------------------------------------------------------------------------------------
     //  public methods
diff --git a/unotools/inc/unotools/workingsetoptions.hxx b/unotools/inc/unotools/workingsetoptions.hxx
index bf9a1c8..613d205 100644
--- a/unotools/inc/unotools/workingsetoptions.hxx
+++ b/unotools/inc/unotools/workingsetoptions.hxx
@@ -48,7 +48,7 @@ class SvtWorkingSetOptions_Impl;
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
 
-class SvtWorkingSetOptions: public utl::detail::Options
+class SAL_WARN_UNUSED SvtWorkingSetOptions : public utl::detail::Options
 {
     //-------------------------------------------------------------------------------------------------------------
     //  public methods


More information about the Libreoffice-commits mailing list