remove option to toggle IsPDFAsStandardPrintJobFormat from UI

to deprecate it. Still possible to toggle from expert config for now,
but we should push on and remove this and all the postscript printing at
this point.

Change-Id: If8869a62616b336764720f5dc56d86b94f16ffbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146169
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index ef7fd46..2cc4b0a 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -46,7 +46,6 @@ private:
    std::unique_ptr<weld::ComboBox> m_xReduceBitmapsResolutionLB;
    std::unique_ptr<weld::CheckButton> m_xReduceBitmapsTransparencyCB;
    std::unique_ptr<weld::CheckButton> m_xConvertToGreyscalesCB;
    std::unique_ptr<weld::CheckButton> m_xPDFCB;
    std::unique_ptr<weld::CheckButton> m_xPaperSizeCB;
    std::unique_ptr<weld::CheckButton> m_xPaperOrientationCB;
    std::unique_ptr<weld::CheckButton> m_xTransparencyCB;
diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx
index 001f322..89178ad 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -26,9 +26,6 @@ enum RestartReason {
    // "For the selected Java runtime environment to work properly,
    // %PRODUCTNAME must be restarted.":
    RESTART_REASON_JAVA,
    // For the modified default print job format to take effect,
    // %PRODUCTNAME must be restarted:
    RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT,
    // "For the bibliography to work properly,
    // %PRODUCTNAME must be restarted.":
    RESTART_REASON_BIBLIOGRAPHY_INSTALL,
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 8d16edf..d804bdf 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -50,24 +50,14 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage(weld::Container* pPag
    , m_xReduceBitmapsResolutionLB(m_xBuilder->weld_combo_box("reducebitmapdpi"))
    , m_xReduceBitmapsTransparencyCB(m_xBuilder->weld_check_button("reducebitmaptrans"))
    , m_xConvertToGreyscalesCB(m_xBuilder->weld_check_button("converttogray"))
    , m_xPDFCB(m_xBuilder->weld_check_button("pdf"))
    , m_xPaperSizeCB(m_xBuilder->weld_check_button("papersize"))
    , m_xPaperOrientationCB(m_xBuilder->weld_check_button("paperorient"))
    , m_xTransparencyCB(m_xBuilder->weld_check_button("trans"))
{
#ifndef ENABLE_CUPS
    m_xPDFCB->hide();
#endif

    if( bOutputForPrinter )
    {
    if (bOutputForPrinter)
        m_xPrinterOutputRB->set_active(true);
    }
    else
    {
        m_xPrintFileOutputRB->set_active(true);
        m_xPDFCB->set_sensitive(false);
    }

    m_xPrinterOutputRB->connect_toggled( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
    m_xPrintFileOutputRB->connect_toggled( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
@@ -182,7 +172,6 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const vcl::printer::Optio

    m_xReduceBitmapsTransparencyCB->set_active( pCurrentOptions->IsReducedBitmapIncludesTransparency() );
    m_xConvertToGreyscalesCB->set_active( pCurrentOptions->IsConvertToGreyscales() );
    m_xPDFCB->set_active( pCurrentOptions->IsPDFAsStandardPrintJobFormat() );

    ClickReduceTransparencyCBHdl(*m_xReduceTransparencyCB);
    ClickReduceGradientsCBHdl(*m_xReduceGradientsCB);
@@ -203,14 +192,6 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( vcl::printer::Options* pCur
                                                                   SAL_N_ELEMENTS(aDPIArray) - 1 ) ] );
    pCurrentOptions->SetReducedBitmapIncludesTransparency( m_xReduceBitmapsTransparencyCB->get_active() );
    pCurrentOptions->SetConvertToGreyscales( m_xConvertToGreyscalesCB->get_active() );
    bool bOrigBackEnd = pCurrentOptions->IsPDFAsStandardPrintJobFormat();
    if (bOrigBackEnd != m_xPDFCB->get_active())
    {
        pCurrentOptions->SetPDFAsStandardPrintJobFormat( m_xPDFCB->get_active() );
        svtools::executeRestartDialog(
                comphelper::getProcessComponentContext(), nullptr,
                svtools::RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT);
    }
}

IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, weld::Toggleable&, void )
@@ -278,12 +259,10 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, weld::Toggl
    {
        ImplUpdateControls( &maPrintFileOptions );
        bOutputForPrinter = false;
        m_xPDFCB->set_sensitive(false);
    }
    else
    {
        ImplSaveControls( &maPrintFileOptions );
        m_xPDFCB->set_sensitive(true);
    }
}

diff --git a/sfx2/uiconfig/ui/optprintpage.ui b/sfx2/uiconfig/ui/optprintpage.ui
index 4af9bf5..615b818 100644
--- a/sfx2/uiconfig/ui/optprintpage.ui
+++ b/sfx2/uiconfig/ui/optprintpage.ui
@@ -588,7 +588,7 @@
        <property name="label-xalign">0</property>
        <property name="shadow-type">none</property>
        <child>
          <!-- n-columns=1 n-rows=3 -->
          <!-- n-columns=1 n-rows=2 -->
          <object class="GtkGrid" id="grid7">
            <property name="visible">True</property>
            <property name="can-focus">False</property>
@@ -596,20 +596,6 @@
            <property name="margin-top">6</property>
            <property name="row-spacing">3</property>
            <child>
              <object class="GtkCheckButton" id="pdf">
                <property name="label" translatable="yes" context="optprintpage|pdf">_PDF as standard print job format</property>
                <property name="visible">True</property>
                <property name="can-focus">True</property>
                <property name="receives-default">False</property>
                <property name="use-underline">True</property>
                <property name="draw-indicator">True</property>
              </object>
              <packing>
                <property name="left-attach">0</property>
                <property name="top-attach">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkCheckButton" id="converttogray">
                <property name="label" translatable="yes" context="optprintpage|converttogray">Con_vert colors to grayscale</property>
                <property name="visible">True</property>
@@ -625,7 +611,7 @@
              </object>
              <packing>
                <property name="left-attach">0</property>
                <property name="top-attach">1</property>
                <property name="top-attach">0</property>
              </packing>
            </child>
            <child>
@@ -644,7 +630,7 @@
              </object>
              <packing>
                <property name="left-attach">0</property>
                <property name="top-attach">2</property>
                <property name="top-attach">1</property>
              </packing>
            </child>
          </object>
diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx
index 30954f1..e41ac16 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -32,9 +32,6 @@ public:
        case svtools::RESTART_REASON_JAVA:
            reason_ = m_xBuilder->weld_widget("reason_java");
            break;
        case svtools::RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT:
            reason_ = m_xBuilder->weld_widget("reason_pdf");
            break;
        case svtools::RESTART_REASON_BIBLIOGRAPHY_INSTALL:
            reason_ = m_xBuilder->weld_widget("reason_bibliography_install");
            break;
diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui
index 9772c16..89fc434 100644
--- a/svtools/uiconfig/ui/restartdialog.ui
+++ b/svtools/uiconfig/ui/restartdialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface domain="svt">
  <requires lib="gtk+" version="3.20"/>
  <object class="GtkDialog" id="RestartDialog">
@@ -94,21 +94,6 @@
              </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" context="restartdialog|reason_pdf">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>
                <property name="xalign">0</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">2</property>
              </packing>
            </child>
            <child>
              <object class="GtkLabel" id="reason_bibliography_install">
                <property name="can-focus">False</property>
                <property name="no-show-all">True</property>