fdo#39111 - UI inconsistent concerning suppression of output for empty pages

Change-Id: I6017e77e46298b45c7584830178455fe29016209
Reviewed-on: https://gerrit.libreoffice.org/9907
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index b083fff..cc07d2c 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -784,7 +784,7 @@ StringArray SCSTR_PRINT_OPTIONS
    ItemList [en-US] =
    {
        < "Pages"; >;
        < "~Include output of empty pages"; >;
        < "~Suppress output of empty pages"; >;
        < "Print content"; >;
        < "~All sheets"; >;
        < "~Selected sheets"; >;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 57a80b5..2662e4c 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -242,10 +242,10 @@ ScPrintUIOptions::ScPrintUIOptions()
    m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("pages", OUString(aStrings.GetString(0)), OUString());

    // create a bool option for empty pages
    m_aUIProperties[nIdx++].Value = setBoolControlOpt("includeemptypages", OUString( aStrings.GetString( 1 ) ),
                                                  ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox",
                                                  "IsIncludeEmptyPages",
                                                  ! bSuppress);
    m_aUIProperties[nIdx++].Value = setBoolControlOpt("suppressemptypages", OUString( aStrings.GetString( 1 ) ),
                                                  ".HelpID:vcl:PrintDialog:IsSuppressEmptyPages:CheckBox",
                                                  "IsSuppressEmptyPages",
                                                  bSuppress);
    // show Subgroup for print content
    vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
    aPrintRangeOpt.maGroupHint = "PrintRange";
@@ -326,9 +326,9 @@ void ScPrintUIOptions::SetDefaults()
                            aPropertyValue.Value <<= nContent;
                            aUIProp[nPropPos].Value <<= aPropertyValue;
                        }
                        else if ( aPropertyValue.Name == "IsIncludeEmptyPages" )
                        else if ( aPropertyValue.Name == "IsSuppressEmptyPages" )
                        {
                            ScUnoHelpFunctions::SetBoolInAny( aPropertyValue.Value, ! bSuppress );
                            ScUnoHelpFunctions::SetBoolInAny( aPropertyValue.Value, bSuppress );
                            aUIProp[nPropPos].Value <<= aPropertyValue;
                        }
                    }
@@ -789,7 +789,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,

    // defaults when no options are passed: all sheets, include empty pages
    bool bSelectedSheetsOnly = false;
    bool bIncludeEmptyPages = true;
    bool bSuppressEmptyPages = true;

    bool bHasPrintContent = false;
    sal_Int32 nPrintContent = 0;        // all sheets / selected sheets / selected cells
@@ -802,9 +802,9 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
        {
            rOptions[i].Value >>= bSelectedSheetsOnly;
        }
        else if ( rOptions[i].Name == "IsIncludeEmptyPages" )
        else if ( rOptions[i].Name == "IsSuppressEmptyPages" )
        {
            rOptions[i].Value >>= bIncludeEmptyPages;
            rOptions[i].Value >>= bSuppressEmptyPages;
        }
        else if ( rOptions[i].Name == "PageRange" )
        {
@@ -933,7 +933,7 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection,
    }

    ScPrintOptions aNewOptions;
    aNewOptions.SetSkipEmpty( !bIncludeEmptyPages );
    aNewOptions.SetSkipEmpty( bSuppressEmptyPages );
    aNewOptions.SetAllSheets( !bSelectedSheetsOnly );
    rStatus.SetOptions( aNewOptions );

diff --git a/sc/uiconfig/scalc/ui/printeroptions.ui b/sc/uiconfig/scalc/ui/printeroptions.ui
index 2c9fb56..789293d 100644
--- a/sc/uiconfig/scalc/ui/printeroptions.ui
+++ b/sc/uiconfig/scalc/ui/printeroptions.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
  <!-- interface-requires gtk+ 3.0 -->
  <requires lib="gtk+" version="3.0"/>
  <object class="GtkBox" id="box">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
@@ -19,13 +20,12 @@
            <property name="can_focus">False</property>
            <property name="left_padding">12</property>
            <child>
              <object class="GtkCheckButton" id="includeemptypages">
                <property name="label" translatable="yes">Include output of empty pages</property>
              <object class="GtkCheckButton" id="suppressemptypages">
                <property name="label" translatable="yes">Suppress output of empty pages</property>
                <property name="use_action_appearance">False</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">False</property>
                <property name="use_action_appearance">False</property>
                <property name="xalign">0</property>
                <property name="draw_indicator">True</property>
              </object>