[Libreoffice-commits] .: officecfg/registry sfx2/inc sfx2/Library_sfx.mk sfx2/source svtools/inc svtools/source svtools/uiconfig vcl/inc vcl/source vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 06:41:06 PST 2012


 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   26 ++++++
 sfx2/Library_sfx.mk                                        |    4 +
 sfx2/inc/sfx2/printopt.hxx                                 |    2 
 sfx2/source/dialog/printopt.cxx                            |   40 ++++++++++
 sfx2/source/dialog/printopt.hrc                            |    2 
 sfx2/source/dialog/printopt.src                            |   19 +++-
 svtools/inc/svtools/printoptions.hxx                       |    6 +
 svtools/inc/svtools/restartdialog.hxx                      |    5 +
 svtools/source/config/printoptions.cxx                     |   52 ++++++++++++-
 svtools/source/dialogs/restartdialog.cxx                   |    9 +-
 svtools/uiconfig/ui/restartdialog.ui                       |   36 ++++++---
 vcl/inc/vcl/jobdata.hxx                                    |    1 
 vcl/inc/vcl/print.hxx                                      |    4 +
 vcl/source/gdi/print.cxx                                   |    6 +
 vcl/unx/generic/printer/cupsmgr.cxx                        |   12 +--
 vcl/unx/generic/printer/jobdata.cxx                        |    6 +
 16 files changed, 203 insertions(+), 27 deletions(-)

New commits:
commit 59b98580bfd70205a9ebdb0ba67e74225d875b43
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 11:50:54 2012 +0000

    Resolves: fdo#44664 Provide a way to set the default print job format.
    
    a) In the print dialog you can temporarily override the default print job
    format for a single print job
    b) In the printer options dialog you can override the default print job format
    for a single printer
    c) Under tools->options->print you can override the default print job format
    for all printers.
    
    Tidy up the restart dialog in passing
    
    Change-Id: Ibea94bab6a79c3590dbf34583013db4e2ac06f45

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index db6caab..cc11bb6 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -3805,6 +3805,19 @@
             </info>
             <value>false</value>
           </prop>
+          <prop
+              oor:name="PDFAsStandardPrintJobFormat" oor:type="xs:boolean"
+              oor:nillable="false">
+            <!-- UIHints: Tools  Options - General  Print  [Section]
+                 PrintFileOptions -->
+            <info>
+              <author>CMC</author>
+              <desc>Indicates whether PDF should be the Standard Print Job
+              format</desc>
+              <label>(PrinterOptions) PDFAsStandardPrintJobFormat</label>
+            </info>
+            <value>true</value>
+          </prop>
         </group>
         <group oor:name="File">
           <info>
@@ -3943,6 +3956,19 @@
             </info>
             <value>false</value>
           </prop>
+          <prop
+              oor:name="PDFAsStandardPrintJobFormat" oor:type="xs:boolean"
+              oor:nillable="false">
+            <!-- UIHints: Tools  Options - General  Print  [Section]
+                 PrintFileOptions -->
+            <info>
+              <author>CMC</author>
+              <desc>Indicates whether PDF should be the Standard Print Job
+              format</desc>
+              <label>(PrintFileOptions) PDFAsStandardPrintJobFormat</label>
+            </info>
+            <value>true</value>
+          </prop>
         </group>
       </group>
     </group>
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 6cc8a1d..58c4e81 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -40,6 +40,10 @@ $(eval $(call gb_Library_set_include,sfx,\
 
 $(eval $(call gb_Library_add_defs,sfx,-DSFX2_DLLIMPLEMENTATION))
 
+$(eval $(call gb_Library_add_defs,sfx,\
+    $(if $(filter TRUE,$(ENABLE_CUPS)),-DENABLE_CUPS) \
+))
+
 ifeq ($(ENABLE_SYSTRAY_GTK),TRUE)
 $(eval $(call gb_Library_add_defs,sfx,\
     -DENABLE_QUICKSTART_APPLET \
diff --git a/sfx2/inc/sfx2/printopt.hxx b/sfx2/inc/sfx2/printopt.hxx
index 24472c0..ccc48ef 100644
--- a/sfx2/inc/sfx2/printopt.hxx
+++ b/sfx2/inc/sfx2/printopt.hxx
@@ -67,6 +67,8 @@ private:
 
     CheckBox            aConvertToGreyscalesCB;
 
+    CheckBox            aPDFCB;
+
     FixedLine           aWarnGB;
 
     CheckBox            aPaperSizeCB;
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 93ce802..4183eef 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -22,8 +22,10 @@
 #include <vcl/msgbox.hxx>
 #include <unotools/printwarningoptions.hxx>
 #include <svtools/printoptions.hxx>
+#include <svtools/restartdialog.hxx>
 #include <svl/flagitem.hxx>
 
+#include <comphelper/processfactory.hxx>
 
 #include "printopt.hrc"
 #include "dialog.hrc"
@@ -58,6 +60,7 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con
     aReduceBitmapsResolutionLB( this, SfxResId( LB_REDUCEBITMAPS_RESOLUTION ) ),
     aReduceBitmapsTransparencyCB( this, SfxResId( CB_REDUCEBITMAPS_TRANSPARENCY ) ),
     aConvertToGreyscalesCB( this, SfxResId( CB_CONVERTTOGREYSCALES ) ),
+    aPDFCB( this, SfxResId( CB_PDF ) ),
     aWarnGB( this, SfxResId( GB_PRINT_WARN ) ),
     aPaperSizeCB( this, SfxResId( CB_PAPERSIZE ) ),
     aPaperOrientationCB( this, SfxResId( CB_PAPERORIENTATION ) ),
@@ -65,6 +68,29 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con
 {
     FreeResource();
 
+#ifndef ENABLE_CUPS
+    long nDiff = aWarnGB.GetPosPixel().Y() - aPDFCB.GetPosPixel().Y();
+    aPDFCB.Hide();
+
+    Point aPoint;
+
+    aPoint = aWarnGB.GetPosPixel();
+    aPoint.Y() -= nDiff;
+    aWarnGB.SetPosPixel(aPoint);
+
+    aPoint = aPaperSizeCB.GetPosPixel();
+    aPoint.Y() -= nDiff;
+    aPaperSizeCB.SetPosPixel(aPoint);
+
+    aPoint = aPaperOrientationCB.GetPosPixel();
+    aPoint.Y() -= nDiff;
+    aPaperOrientationCB.SetPosPixel(aPoint);
+
+    aPoint = aTransparencyCB.GetPosPixel();
+    aPoint.Y() -= nDiff;
+    aTransparencyCB.SetPosPixel(aPoint);
+#endif
+
     aOutputGB.SetStyle( aOutputGB.GetStyle() | WB_NOLABEL );
 
     if( bOutputForPrinter )
@@ -76,6 +102,7 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con
     {
         aPrintFileOutputRB.Check( sal_True );
         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrintFileOutputRB.GetText() ) );
+        aPDFCB.Disable();
     }
 
     aPrinterOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
@@ -237,6 +264,7 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu
 
     aReduceBitmapsTransparencyCB.Check( pCurrentOptions->IsReducedBitmapIncludesTransparency() );
     aConvertToGreyscalesCB.Check( pCurrentOptions->IsConvertToGreyscales() );
+    aPDFCB.Check( pCurrentOptions->IsPDFAsStandardPrintJobFormat() );
 
     ClickReduceTransparencyCBHdl( &aReduceTransparencyCB );
     ClickReduceGradientsCBHdl( &aReduceGradientsCB );
@@ -355,6 +383,14 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOpt
                                                             (sal_uInt16)( (sizeof (aDPIArray) / sizeof (aDPIArray[0])) - 1 ) ) ] );
     pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() );
     pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() );
+    sal_Bool bOrigBackEnd = pCurrentOptions->IsPDFAsStandardPrintJobFormat();
+    if (bOrigBackEnd != aPDFCB.IsChecked())
+    {
+        pCurrentOptions->SetPDFAsStandardPrintJobFormat( aPDFCB.IsChecked() );
+            svtools::executeRestartDialog(
+                comphelper::getProcessComponentContext(), 0,
+                svtools::RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT);
+    }
 }
 
 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox*, pBox )
@@ -445,9 +481,13 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton
         bOutputForPrinter = sal_False;
         // #i63982#
         ImplSetAccessibleNames();
+        aPDFCB.Disable();
     }
     else
+    {
         ImplSaveControls( &maPrintFileOptions );
+        aPDFCB.Enable();
+    }
 
     return 0;
 }
diff --git a/sfx2/source/dialog/printopt.hrc b/sfx2/source/dialog/printopt.hrc
index bdc04b2..6df6866 100644
--- a/sfx2/source/dialog/printopt.hrc
+++ b/sfx2/source/dialog/printopt.hrc
@@ -46,3 +46,5 @@
 #define CB_PAPERSIZE                    51
 #define CB_PAPERORIENTATION             52
 #define CB_TRANSPARENCY                 53
+
+#define CB_PDF                          54
diff --git a/sfx2/source/dialog/printopt.src b/sfx2/source/dialog/printopt.src
index a21e09b..648ad50 100644
--- a/sfx2/source/dialog/printopt.src
+++ b/sfx2/source/dialog/printopt.src
@@ -210,9 +210,20 @@ TabPage TP_COMMONPRINTOPTIONS
 
     // -----------
 
+    CheckBox CB_PDF
+    {
+        HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEBITMAPS";
+        TabStop = TRUE;
+        Pos = MAP_APPFONT ( 18, 146 ) ;
+        Size = MAP_APPFONT ( 115, 10 ) ;
+        Text [ en-US ] = "PDF as Standard Print Job Format";
+    };
+
+    // -----------
+
     FixedLine GB_PRINT_WARN
     {
-        Pos = MAP_APPFONT ( 6, 148 ) ;
+        Pos = MAP_APPFONT ( 6, 162 ) ;
         Size = MAP_APPFONT ( 248 , 8 ) ;
         Text [ en-US ] = "Printer warnings" ;
     };
@@ -220,7 +231,7 @@ TabPage TP_COMMONPRINTOPTIONS
     {
         HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERSIZE";
         TabStop = TRUE;
-        Pos = MAP_APPFONT ( 12, 159 ) ;
+        Pos = MAP_APPFONT ( 12, 173 ) ;
         Size = MAP_APPFONT ( 123, 10 ) ;
         Text [ en-US ] = "P~aper size" ;
     };
@@ -228,7 +239,7 @@ TabPage TP_COMMONPRINTOPTIONS
     {
         HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERORIENTATION";
         TabStop = TRUE;
-        Pos = MAP_APPFONT ( 12, 172 ) ;
+        Pos = MAP_APPFONT ( 12, 186 ) ;
         Size = MAP_APPFONT ( 123 , 10 ) ;
         Text [ en-US ] = "Pap~er orientation" ;
     };
@@ -236,7 +247,7 @@ TabPage TP_COMMONPRINTOPTIONS
     {
         HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_TRANSPARENCY";
         TabStop = TRUE;
-        Pos = MAP_APPFONT ( 136, 159 ) ;
+        Pos = MAP_APPFONT ( 136, 173 ) ;
         Size = MAP_APPFONT ( 123, 10 ) ;
         Text [ en-US ] = "~Transparency";
     };
diff --git a/svtools/inc/svtools/printoptions.hxx b/svtools/inc/svtools/printoptions.hxx
index 8c882e1..e3e70e7 100644
--- a/svtools/inc/svtools/printoptions.hxx
+++ b/svtools/inc/svtools/printoptions.hxx
@@ -60,7 +60,8 @@ public:
     sal_Int16   GetReducedBitmapMode() const;
     sal_Int16   GetReducedBitmapResolution() const;
     sal_Bool    IsReducedBitmapIncludesTransparency() const;
-       sal_Bool IsConvertToGreyscales() const;
+    sal_Bool    IsConvertToGreyscales() const;
+    sal_Bool    IsPDFAsStandardPrintJobFormat() const;
 
     void        SetReduceTransparency( sal_Bool bState );
     void        SetReducedTransparencyMode( sal_Int16 nMode );
@@ -71,7 +72,8 @@ public:
     void        SetReducedBitmapMode( sal_Int16   bState );
     void        SetReducedBitmapResolution( sal_Int16 nResolution );
     void        SetReducedBitmapIncludesTransparency( sal_Bool bState );
-       void        SetConvertToGreyscales( sal_Bool bState );
+    void        SetConvertToGreyscales( sal_Bool bState );
+    void        SetPDFAsStandardPrintJobFormat( sal_Bool bState );
 
 public:
 
diff --git a/svtools/inc/svtools/restartdialog.hxx b/svtools/inc/svtools/restartdialog.hxx
index 85afd7d..91ff4ea 100644
--- a/svtools/inc/svtools/restartdialog.hxx
+++ b/svtools/inc/svtools/restartdialog.hxx
@@ -23,9 +23,12 @@ namespace com { namespace sun { namespace star { namespace uno {
 namespace svtools {
 
 enum RestartReason {
-    RESTART_REASON_JAVA
+    RESTART_REASON_JAVA,
         // "For the selected Java runtime environment to work properly,
         // %PRODUCTNAME must be restarted."
+    RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT
+        // For the modified default print job format to take effect,
+        // %PRODUCTNAME must be restarted.
 };
 
 SVT_DLLPUBLIC void executeRestartDialog(
diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx
index 039c7e9..3d0c0c0 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -64,6 +64,7 @@ static sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
 #define PROPERTYNAME_REDUCEDBITMAPRESOLUTION            OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapResolution"))
 #define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY  OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapIncludesTransparency"))
 #define PROPERTYNAME_CONVERTTOGREYSCALES                OUString(RTL_CONSTASCII_USTRINGPARAM("ConvertToGreyscales"))
+#define PROPERTYNAME_PDFASSTANDARDPRINTJOBFORMAT        OUString(RTL_CONSTASCII_USTRINGPARAM("PDFAsStandardPrintJobFormat"))
 
 // --------------
 // - Namespaces -
@@ -116,7 +117,8 @@ public:
     sal_Int16   GetReducedBitmapMode() const ;
     sal_Int16   GetReducedBitmapResolution() const ;
     sal_Bool    IsReducedBitmapIncludesTransparency() const ;
-       sal_Bool IsConvertToGreyscales() const;
+    sal_Bool    IsConvertToGreyscales() const;
+    sal_Bool    IsPDFAsStandardPrintJobFormat() const;
 
     void        SetReduceTransparency( sal_Bool bState ) ;
     void        SetReducedTransparencyMode( sal_Int16 nMode ) ;
@@ -127,7 +129,8 @@ public:
     void        SetReducedBitmapMode( sal_Int16 nMode ) ;
     void        SetReducedBitmapResolution( sal_Int16 nResolution ) ;
     void        SetReducedBitmapIncludesTransparency( sal_Bool bState ) ;
-       void        SetConvertToGreyscales( sal_Bool bState ) ;
+    void        SetConvertToGreyscales( sal_Bool bState ) ;
+    void        SetPDFAsStandardPrintJobFormat( sal_Bool bState ) ;
 
 //-------------------------------------------------------------------------------------------------------------
 //  private API
@@ -393,6 +396,28 @@ sal_Bool SvtPrintOptions_Impl::IsConvertToGreyscales() const
 
 }
 
+sal_Bool SvtPrintOptions_Impl::IsPDFAsStandardPrintJobFormat() const
+{
+    sal_Bool bRet = sal_True;
+    try
+    {
+        if (m_xNode.is())
+        {
+            css::uno::Reference<css::beans::XPropertySet> xSet(m_xNode, css::uno::UNO_QUERY);
+            if (xSet.is())
+            {
+                xSet->getPropertyValue(PROPERTYNAME_PDFASSTANDARDPRINTJOBFORMAT) >>= bRet;
+            }
+        }
+    }
+    catch (const css::uno::Exception& ex)
+    {
+        SAL_WARN("svtools", "Caught unexpected: " << ex.Message);
+    }
+
+    return  bRet;
+}
+
 void SvtPrintOptions_Impl::SetReduceTransparency(sal_Bool bState)
 {
     impl_setValue(PROPERTYNAME_REDUCETRANSPARENCY, bState);
@@ -443,6 +468,11 @@ void SvtPrintOptions_Impl::SetConvertToGreyscales(sal_Bool bState)
     impl_setValue(PROPERTYNAME_CONVERTTOGREYSCALES, bState);
 }
 
+void SvtPrintOptions_Impl::SetPDFAsStandardPrintJobFormat(sal_Bool bState)
+{
+    impl_setValue(PROPERTYNAME_PDFASSTANDARDPRINTJOBFORMAT, bState);
+}
+
 SvtPrintOptions_Impl::~SvtPrintOptions_Impl()
 {
     m_xNode.clear();
@@ -628,6 +658,14 @@ sal_Bool SvtBasePrintOptions::IsConvertToGreyscales() const
 
 // -----------------------------------------------------------------------------
 
+sal_Bool SvtBasePrintOptions::IsPDFAsStandardPrintJobFormat() const
+{
+    MutexGuard aGuard( GetOwnStaticMutex() );
+    return m_pDataContainer->IsPDFAsStandardPrintJobFormat();
+}
+
+// -----------------------------------------------------------------------------
+
 void SvtBasePrintOptions::SetReduceTransparency( sal_Bool bState )
 {
     MutexGuard aGuard( GetOwnStaticMutex() );
@@ -708,6 +746,14 @@ void SvtBasePrintOptions::SetConvertToGreyscales( sal_Bool bState )
 
 // -----------------------------------------------------------------------------
 
+void SvtBasePrintOptions::SetPDFAsStandardPrintJobFormat( sal_Bool bState )
+{
+    MutexGuard aGuard( GetOwnStaticMutex() );
+    m_pDataContainer->SetPDFAsStandardPrintJobFormat( bState );
+}
+
+// -----------------------------------------------------------------------------
+
 void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const
 {
     rOptions.SetReduceTransparency( IsReduceTransparency() );
@@ -720,6 +766,7 @@ void SvtBasePrintOptions::GetPrinterOptions( PrinterOptions& rOptions ) const
     rOptions.SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) GetReducedBitmapResolution(), (sal_uInt16)( DPI_COUNT - 1 ) ) ] );
     rOptions.SetReducedBitmapIncludesTransparency( IsReducedBitmapIncludesTransparency() );
     rOptions.SetConvertToGreyscales( IsConvertToGreyscales() );
+    rOptions.SetPDFAsStandardPrintJobFormat( IsPDFAsStandardPrintJobFormat() );
 }
 
 // -----------------------------------------------------------------------------
@@ -739,6 +786,7 @@ void SvtBasePrintOptions::SetPrinterOptions( const PrinterOptions& rOptions )
         sal::static_int_cast< sal_Int16 >(rOptions.GetReducedBitmapMode()) );
     SetReducedBitmapIncludesTransparency( rOptions.IsReducedBitmapIncludesTransparency() );
     SetConvertToGreyscales( rOptions.IsConvertToGreyscales() );
+    SetPDFAsStandardPrintJobFormat( rOptions.IsPDFAsStandardPrintJobFormat() );
 
     const sal_uInt16 nDPI = rOptions.GetReducedBitmapResolution();
 
diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx
index 1004a2d..2e8428f 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -30,16 +30,19 @@ public:
     RestartDialog(Window * parent, svtools::RestartReason reason):
         ModalDialog(parent, "RestartDialog", "svt/ui/restartdialog.ui")
     {
-        get(reasonJava_, "reason_java");
         get(btnYes_, "yes");
         get(btnNo_, "no");
         switch (reason) {
         case svtools::RESTART_REASON_JAVA:
-            reasonJava_->Show();
+            get(reason_, "reason_java");
+            break;
+        case svtools::RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT:
+            get(reason_, "reason_pdf");
             break;
         default:
             assert(false); // this cannot happen
         }
+        reason_->Show();
         btnYes_->SetClickHdl(LINK(this, RestartDialog, hdlYes));
         btnNo_->SetClickHdl(LINK(this, RestartDialog, hdlNo));
     }
@@ -48,7 +51,7 @@ private:
     DECL_LINK(hdlYes, void *);
     DECL_LINK(hdlNo, void *);
 
-    Window * reasonJava_;
+    Window * reason_;
     PushButton * btnYes_;
     PushButton * btnNo_;
 };
diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui
index dd041b4..475dfbd 100644
--- a/svtools/uiconfig/ui/restartdialog.ui
+++ b/svtools/uiconfig/ui/restartdialog.ui
@@ -1,17 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
--->
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="RestartDialog">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
+    <property name="title" translatable="yes">Restart %PRODUCTNAME</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
@@ -26,9 +19,13 @@
             <child>
               <object class="GtkButton" id="yes">
                 <property name="label" translatable="yes">Restart now</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
                 <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -39,9 +36,11 @@
             <child>
               <object class="GtkButton" id="no">
                 <property name="label" translatable="yes">Restart later</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -62,10 +61,14 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="orientation">vertical</property>
+            <property name="spacing">16</property>
             <child>
               <object class="GtkLabel" id="reason_java">
                 <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
                 <property name="label" translatable="yes">For the selected Java runtime environment to work properly, %PRODUCTNAME must be restarted.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">30</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -74,15 +77,30 @@
               </packing>
             </child>
             <child>
+              <object class="GtkLabel" id="reason_pdf">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">For the modified default print job format to take effect, %PRODUCTNAME must be restarted.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">50</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkLabel" id="label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Do you want to restart %PRODUCTNAME now?</property>
+                <property name="wrap">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
           </object>
diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx
index 45f7f7e..5485e01 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -68,6 +68,7 @@ struct VCL_DLLPUBLIC JobData
     void setCollate( bool bCollate );
     bool setPaper( int nWidth, int nHeight ); // dimensions in pt
     bool setPaperBin( int nPaperBin ); // dimensions in pt
+    void setDefaultBackend( bool bUsePDF );
 
     // creates a new buffer using new
     // it is up to the user to delete it again
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 17d12c1..509e1c6 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -161,6 +161,7 @@ private:
     sal_uInt16                      mnReducedBitmapResolution;
     sal_Bool                        mbReducedBitmapsIncludeTransparency;
     sal_Bool                        mbConvertToGreyscales;
+    sal_Bool                        mbPDFAsStandardPrintJobFormat;
 
 public:
 
@@ -197,6 +198,9 @@ public:
     sal_Bool                        IsConvertToGreyscales() const { return mbConvertToGreyscales; }
     void                        SetConvertToGreyscales( sal_Bool bSet ) { mbConvertToGreyscales = bSet; }
 
+    sal_Bool                        IsPDFAsStandardPrintJobFormat() const { return mbPDFAsStandardPrintJobFormat; }
+    void                        SetPDFAsStandardPrintJobFormat( sal_Bool bSet ) { mbPDFAsStandardPrintJobFormat = bSet; }
+
     // read printer options from configuration, parameter decides whether the set for
     // print "to printer" or "to file" should be read.
     // returns true if config was read, false if an error occured
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 9e948c9..7037a1f 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -117,7 +117,8 @@ PrinterOptions::PrinterOptions() :
     meReducedBitmapMode( PRINTER_BITMAP_NORMAL ),
     mnReducedBitmapResolution( 200 ),
     mbReducedBitmapsIncludeTransparency( sal_True ),
-    mbConvertToGreyscales( sal_False )
+    mbConvertToGreyscales( sal_False ),
+    mbPDFAsStandardPrintJobFormat( sal_False )
 {
 }
 
@@ -137,6 +138,7 @@ PrinterOptions::~PrinterOptions()
 #define PROPERTYNAME_REDUCEDBITMAPRESOLUTION            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapResolution"))
 #define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReducedBitmapIncludesTransparency"))
 #define PROPERTYNAME_CONVERTTOGREYSCALES                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ConvertToGreyscales"))
+#define PROPERTYNAME_PDFASSTANDARDPRINTJOBFORMAT        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PDFAsStandardPrintJobFormat"))
 
 bool PrinterOptions::ReadFromConfig( bool i_bFile )
 {
@@ -195,6 +197,8 @@ bool PrinterOptions::ReadFromConfig( bool i_bFile )
                         SetReducedBitmapIncludesTransparency( bValue );
                     if( xSet->getPropertyValue(PROPERTYNAME_CONVERTTOGREYSCALES) >>= bValue )
                         SetConvertToGreyscales( bValue );
+                    if( xSet->getPropertyValue(PROPERTYNAME_PDFASSTANDARDPRINTJOBFORMAT) >>= bValue )
+                        SetPDFAsStandardPrintJobFormat( bValue );
 
                     bSuccess = true;
                 }
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index e23aedc..a1d8d49 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -33,6 +33,8 @@
 
 #include "rtl/ustrbuf.hxx"
 
+#include <officecfg/Office/Common.hxx>
+
 #include <algorithm>
 
 using namespace psp;
@@ -284,10 +286,11 @@ void CUPSManager::initialize()
     if( pOpt )
     {
         m_bUseIncludeFeature = true;
-        bUsePDF = true;
-        if( m_aGlobalDefaults.m_nPSLevel == 0 && m_aGlobalDefaults.m_nPDFDevice == 0 )
-            m_aGlobalDefaults.m_nPDFDevice = 1;
+        bUsePDF = officecfg::Office::Common::Print::Option::Printer::PDFAsStandardPrintJobFormat::get();
     }
+
+    m_aGlobalDefaults.setDefaultBackend(bUsePDF);
+
     // do not send include JobPatch; CUPS will insert that itself
     // TODO: currently unknown which versions of CUPS insert JobPatches
     // so currently it is assumed CUPS = don't insert JobPatch files
@@ -351,8 +354,7 @@ void CUPSManager::initialize()
             aPrinter.m_aInfo.m_pParser = c_it->second.getParser();
             aPrinter.m_aInfo.m_aContext = c_it->second;
         }
-        if( bUsePDF && aPrinter.m_aInfo.m_nPSLevel == 0 && aPrinter.m_aInfo.m_nPDFDevice == 0 )
-            aPrinter.m_aInfo.m_nPDFDevice = 1;
+        aPrinter.m_aInfo.setDefaultBackend(bUsePDF);
         aPrinter.m_aInfo.m_aDriverName = aBuf.makeStringAndClear();
         aPrinter.m_bModified = false;
 
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index bd18b19..385ed02 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -269,4 +269,10 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
     return bVersion && bPrinter && bOrientation && bCopies && bContext && bMargin && bPSLevel && bPDFDevice && bColorDevice && bColorDepth;
 }
 
+void JobData::setDefaultBackend(bool bUsePDF)
+{
+    if (bUsePDF && m_nPSLevel == 0 && m_nPDFDevice == 0)
+        m_nPDFDevice = 1;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list