basctl/source/basicide/basicrenderable.cxx |   27 ++++++++-----
 sc/source/ui/unoobj/docuno.cxx             |   58 ++++++++++++++++++++---------
 sd/inc/DocumentRenderer.hrc                |    4 --
 sd/source/ui/view/DocumentRenderer.cxx     |   26 ++++++-------
 sw/source/core/doc/doc.cxx                 |   11 ++---
 sw/source/core/view/printdata.cxx          |   50 +++++++++++++------------
 vcl/uiconfig/ui/printdialog.ui             |   43 +++++++++------------
 7 files changed, 118 insertions(+), 101 deletions(-)

New commits:
commit 482507d7bbc915fd5a10c64bfb60695b2a233a12
Author:     Srijan Bhatia <srijanbhatia...@gmail.com>
AuthorDate: Thu Jun 18 18:41:14 2020 +0530
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Oct 27 18:36:27 2020 +0100

    tdf#127680 Add the option to print even or odd values from a particular 
range
    
    Added a box besides the pages option that lets the user choose between left 
and right pages/left pages/right pages.
    
    Change-Id: Iee0386f4f3cfd2dac3fcf898a3fefb5434cb27a8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96612
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104877
    Reviewed-by: Sophie Gautier <so...@libreoffice.org>

diff --git a/basctl/source/basicide/basicrenderable.cxx 
b/basctl/source/basicide/basicrenderable.cxx
index eae8b5c81c93..8e4bab711ce8 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -37,7 +37,7 @@ Renderable::Renderable (BaseWindow* pWin)
 : cppu::WeakComponentImplHelper< css::view::XRenderable >( maMutex )
 , mpWindow( pWin )
 {
-    m_aUIProperties.resize( 3 );
+    m_aUIProperties.resize( 4 );
 
     // show Subgroup for print range
     vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
@@ -50,17 +50,11 @@ Renderable::Renderable (BaseWindow* pWin)
     // create a choice for the range to print
     OUString aPrintContentName( "PrintContent" );
     const Sequence<OUString> aChoices{IDEResId(RID_STR_PRINTDLG_PRINTALLPAGES),
-                                      IDEResId(RID_STR_PRINTDLG_PRINTPAGES),
-                                      
IDEResId(RID_STR_PRINTDLG_PRINTEVENPAGES),
-                                      
IDEResId(RID_STR_PRINTDLG_PRINTODDPAGES)};
+                                      IDEResId(RID_STR_PRINTDLG_PRINTPAGES)};
     const Sequence<OUString> 
aHelpIds{".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0",
-                                      
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1",
-                                      
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2",
-                                      
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:3"};
+                                      
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1"};
     const Sequence<OUString> aWidgetIds{"rbAllPages",
-                                        "rbRangePages",
-                                        "rbEvenPages",
-                                        "rbOddPages"};
+                                        "rbRangePages"};
     m_aUIProperties[1].Value = setChoiceRadiosControlOpt(aWidgetIds, 
OUString(),
                                                    aHelpIds, aPrintContentName,
                                                    aChoices, 0);
@@ -70,6 +64,16 @@ Renderable::Renderable (BaseWindow* pWin)
     m_aUIProperties[2].Value = setEditControlOpt("pagerange", OUString(),
                                                  OUString(), "PageRange",
                                                  OUString(), aPageRangeOpt);
+
+    vcl::PrinterOptionsHelper::UIControlOptions aEvenOddOpt(aPrintContentName, 
0, true);
+    m_aUIProperties[3].Value = setChoiceListControlOpt("evenoddbox",
+                                                        OUString(),
+                                                        
uno::Sequence<OUString>(),
+                                                        "EvenOdd",
+                                                        
uno::Sequence<OUString>(),
+                                                        0,
+                                                        uno::Sequence< 
sal_Bool >(),
+                                                        aEvenOddOpt);
 }
 
 Renderable::~Renderable()
@@ -130,6 +134,7 @@ sal_Int32 SAL_CALL Renderable::getRendererCount (
         }
 
         sal_Int64 nContent = getIntValue( "PrintContent", -1 );
+        sal_Int64 nEOContent = getIntValue ("EvenOdd", -1);
         if( nContent == 1 )
         {
             OUString aPageRange( getStringValue( "PageRange" ) );
@@ -141,7 +146,7 @@ sal_Int32 SAL_CALL Renderable::getRendererCount (
                     nCount = nSelCount;
             }
         }
-        else if ( nContent == 2 || nContent == 3 ) // even/odd pages
+        else if ( nEOContent == 1 || nEOContent == 2 ) // even/odd pages
             return static_cast<sal_Int32>( maValidPages.size() );
     }
 
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 2a4153756eb1..dec6a92b3362 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -249,7 +249,7 @@ ScPrintUIOptions::ScPrintUIOptions()
     sal_Int32 nContent = rPrintOpt.GetAllSheets() ? 0 : 1;
     bool bSuppress = rPrintOpt.GetSkipEmpty();
 
-    sal_Int32 nNumProps= 9, nIdx = 0;
+    sal_Int32 nNumProps= 10, nIdx = 0;
 
     m_aUIProperties.resize(nNumProps);
 
@@ -297,21 +297,15 @@ ScPrintUIOptions::ScPrintUIOptions()
 
     // create a choice for the range to print
     OUString aPrintRangeName( "PrintRange" );
-    aChoices.realloc( 4 );
-    aHelpIds.realloc( 4 );
-    uno::Sequence< OUString > aWidgetIds( 4 );
+    aChoices.realloc( 2 );
+    aHelpIds.realloc( 2 );
+    uno::Sequence< OUString > aWidgetIds( 2 );
     aChoices[0] = ScResId( SCSTR_PRINTOPT_PRINTALLPAGES );
     aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0";
     aWidgetIds[0] = "rbAllPages";
     aChoices[1] = ScResId( SCSTR_PRINTOPT_PRINTPAGES );
     aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1";
     aWidgetIds[1] = "rbRangePages";
-    aChoices[2] = ScResId( SCSTR_PRINTOPT_PRINTEVENPAGES );
-    aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:2";
-    aWidgetIds[2] = "rbEvenPages";
-    aChoices[3] = ScResId( SCSTR_PRINTOPT_PRINTODDPAGES );
-    aHelpIds[3] = ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:3";
-    aWidgetIds[3] = "rbOddPages";
     m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, 
OUString(),
                                                     aHelpIds,
                                                     aPrintRangeName,
@@ -324,6 +318,16 @@ ScPrintUIOptions::ScPrintUIOptions()
                                                       
".HelpID:vcl:PrintDialog:PageRange:Edit",
                                                       "PageRange", OUString(), 
aPageRangeOpt);
 
+    vcl::PrinterOptionsHelper::UIControlOptions aEvenOddOpt(aPrintRangeName, 
0, true);
+    m_aUIProperties[ nIdx++ ].Value = setChoiceListControlOpt("evenoddbox",
+                                                           OUString(),
+                                                           
uno::Sequence<OUString>(),
+                                                           "EvenOdd",
+                                                           
uno::Sequence<OUString>(),
+                                                           0,
+                                                           uno::Sequence< 
sal_Bool >(),
+                                                           aEvenOddOpt);
+
     assert(nIdx == nNumProps);
 }
 
@@ -1409,7 +1413,8 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& 
aSelection,
 
     bool bHasPrintContent = false;
     sal_Int32 nPrintContent = 0;        // all sheets / selected sheets / 
selected cells
-    sal_Int32 nPrintRange = 0;          // all pages / pages / even pages / 
odd pages
+    sal_Int32 nPrintRange = 0;          // all pages / pages
+    sal_Int32 nEOContent = 0;          // even pages / odd pages
     OUString aPageRange;           // "pages" edit value
 
     for( const auto& rOption : rOptions )
@@ -1430,6 +1435,10 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& 
aSelection,
         {
             rOption.Value >>= nPrintRange;
         }
+        else if ( rOption.Name == "EvenOdd" )
+        {
+            rOption.Value >>= nEOContent;
+        }
         else if ( rOption.Name == "PrintContent" )
         {
             bHasPrintContent = true;
@@ -1593,6 +1602,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const 
uno::Any& aSelection,
     maValidPages.clear();
 
     sal_Int32 nContent = 0;
+    sal_Int32 nEOContent = 0;
     bool bSinglePageSheets = false;
     for ( const auto& rValue : rOptions)
     {
@@ -1604,6 +1614,10 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const 
uno::Any& aSelection,
         {
             rValue.Value >>= bSinglePageSheets;
         }
+        else if ( rValue.Name == "EvenOdd" )
+        {
+            rValue.Value >>= nEOContent;
+        }
     }
 
     if (bSinglePageSheets)
@@ -1611,8 +1625,8 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const 
uno::Any& aSelection,
         return pDocShell->GetDocument().GetTableCount();
     }
 
-    bool bIsPrintEvenPages = nContent != 3;
-    bool bIsPrintOddPages = nContent != 2;
+    bool bIsPrintEvenPages = (nEOContent != 2 && nContent == 0) || nContent != 
0;
+    bool bIsPrintOddPages = (nEOContent != 1 && nContent == 0) || nContent != 
0;
 
     for ( sal_Int32 nPage = 1; nPage <= nPages; nPage++ )
     {
@@ -1622,7 +1636,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const 
uno::Any& aSelection,
 
     sal_Int32 nSelectCount = static_cast<sal_Int32>( maValidPages.size() );
 
-    if ( nContent == 2 || nContent == 3 ) // even pages / odd pages
+    if ( nEOContent == 1 || nEOContent == 2 ) // even pages / odd pages
         return nSelectCount;
 
     if ( !aPagesStr.isEmpty() )
@@ -1824,19 +1838,23 @@ uno::Sequence<beans::PropertyValue> SAL_CALL 
ScModelObj::getRenderer( sal_Int32
         pPrintFunc->SetRenderFlag( true );
 
         sal_Int32 nContent = 0;
+        sal_Int32 nEOContent = 0;
         for ( const auto& rValue : rOptions)
         {
             if ( rValue.Name == "PrintRange" )
             {
                 rValue.Value >>= nContent;
-                break;
+            }
+            else if ( rValue.Name == "EvenOdd" )
+            {
+                rValue.Value >>= nEOContent;
             }
         }
 
         MultiSelection aPage;
         aPage.SetTotalRange( Range(0,RANGE_MAX) );
 
-        bool bOddOrEven = nContent == 2 || nContent == 3; // even pages or odd 
pages
+        bool bOddOrEven = (nContent == 0 && nEOContent == 1) || (nContent == 1 
&& nEOContent == 2); // even pages or odd pages
         // tdf#127682 when odd/even allow nRenderer of 0 even when 
maValidPages is empty
         // to allow PrinterController::abortJob to spool an empty page as part 
of
         // its abort procedure
@@ -2054,19 +2072,23 @@ void SAL_CALL ScModelObj::render( sal_Int32 
nSelRenderer, const uno::Any& aSelec
         pPrintFunc->SetExclusivelyDrawOleAndDrawObjects();
 
     sal_Int32 nContent = 0;
+    sal_Int32 nEOContent = 0;
     for ( const auto& rValue : rOptions)
     {
         if ( rValue.Name == "PrintRange" )
         {
             rValue.Value >>= nContent;
-            break;
+        }
+        else if ( rValue.Name == "EvenOdd" )
+        {
+            rValue.Value >>= nEOContent;
         }
     }
 
     MultiSelection aPage;
     aPage.SetTotalRange( Range(0,RANGE_MAX) );
 
-    bool bOddOrEven = nContent == 2 || nContent == 3; // even pages or odd 
pages
+    bool bOddOrEven = (nContent == 0 && nEOContent == 1) || (nContent == 0 && 
nEOContent == 2); // even pages or odd pages
     // tdf#127682 when odd/even allow nRenderer of 0 even when maValidPages is 
empty
     // to allow PrinterController::abortJob to spool an empty page as part of
     // its abort procedure
diff --git a/sd/inc/DocumentRenderer.hrc b/sd/inc/DocumentRenderer.hrc
index 1a86bfd31e7f..1b2cefe4732f 100644
--- a/sd/inc/DocumentRenderer.hrc
+++ b/sd/inc/DocumentRenderer.hrc
@@ -81,8 +81,6 @@ const char* STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE[] =
 {
     NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "All ~Slides"),
     NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "S~lides:"),
-    NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Even slides"),
-    NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Odd slides"),
     NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Selection")
 };
 
@@ -90,8 +88,6 @@ const char* STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE[] =
 {
     NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "All ~Pages"),
     NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "~Pages:"),
-    NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Even pages"),
-    NC_("STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE", "~Odd pages"),
     NC_("STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE", "~Selection")
 };
 
diff --git a/sd/source/ui/view/DocumentRenderer.cxx 
b/sd/source/ui/view/DocumentRenderer.cxx
index 97672fba3932..8a9be771b149 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -186,14 +186,14 @@ namespace {
 
         bool IsPrintFrontPage() const
         {
-            sal_Int32 nInclude = 
static_cast<sal_Int32>(mrProperties.getIntValue( "PrintContent", 0 ));
-            return nInclude != 2;
+            sal_Int32 nInclude = 
static_cast<sal_Int32>(mrProperties.getIntValue( "EvenOdd", 0 ));
+            return nInclude != 1;
         }
 
         bool IsPrintBackPage() const
         {
-            sal_Int32 nInclude = 
static_cast<sal_Int32>(mrProperties.getIntValue( "PrintContent", 0 ));
-            return nInclude != 3;
+            sal_Int32 nInclude = 
static_cast<sal_Int32>(mrProperties.getIntValue( "EvenOdd", 0 ));
+            return nInclude != 2;
         }
 
         bool IsPaperBin() const
@@ -211,7 +211,7 @@ namespace {
             sal_Int32 nContent = 
static_cast<sal_Int32>(mrProperties.getIntValue( "PrintContent", 0 ));
             OUString sFullRange = "1-" + OUString::number(nPageCount);
 
-            if (nContent == 0 || nContent == 2 || nContent == 3 ) // all 
pages/slides || even pages/slides || odd pages/slides
+            if (nContent == 0) // all pages/slides
             {
                 return sFullRange;
             }
@@ -222,7 +222,7 @@ namespace {
                 return sValue.isEmpty() ? sFullRange : sValue;
             }
 
-            if (nContent == 4 && // selection
+            if (nContent == 2 && // selection
                 nCurrentPageIndex >= 0)
             {
                 return OUString::number(nCurrentPageIndex + 1);
@@ -632,18 +632,14 @@ namespace {
                                 nPrintRange ) );
 */
             OUString aPrintRangeName( "PrintContent" );
-            aHelpIds.realloc( 5 );
+            aHelpIds.realloc( 3 );
             aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" 
;
             aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" 
;
             aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" 
;
-            aHelpIds[3] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:3" 
;
-            aHelpIds[4] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:4" 
;
-            aWidgetIds.realloc( 5 );
+            aWidgetIds.realloc( 3 );
             aWidgetIds[0] = "rbAllPages";
             aWidgetIds[1] = "rbRangePages";
-            aWidgetIds[2] = "rbEvenPages";
-            aWidgetIds[3] = "rbOddPages";
-            aWidgetIds[4] = "rbRangeSelection";
+            aWidgetIds[2] = "rbRangeSelection";
 
             AddDialogControl( 
vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt(aWidgetIds, OUString(),
                                 aHelpIds, aPrintRangeName,
@@ -656,6 +652,10 @@ namespace {
             
AddDialogControl(vcl::PrinterOptionsHelper::setEditControlOpt("pagerange", "",
                                 ".HelpID:vcl:PrintDialog:PageRange:Edit", 
"PageRange",
                                 aPageRange, aPageRangeOpt));
+            vcl::PrinterOptionsHelper::UIControlOptions 
aEvenOddOpt(aPrintRangeName, -1, true);
+            
AddDialogControl(vcl::PrinterOptionsHelper::setChoiceListControlOpt("evenoddbox",
 "",
+                                uno::Sequence<OUString>(), "EvenOdd", 
uno::Sequence<OUString>(),
+                                0, uno::Sequence<sal_Bool>(), aEvenOddOpt));
         }
 
         void AddDialogControl( const Any& i_rCtrl )
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 6ed9811d6c3e..3609e634e598 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -669,7 +669,7 @@ void SwDoc::CalculatePagesForPrinting(
     sal_Int32 nDocPageCount )
 {
     const sal_Int64 nContent = rOptions.getIntValue( "PrintContent", 0 );
-    const bool bPrintSelection = nContent == 4;
+    const bool bPrintSelection = nContent == 2;
 
     // properties to take into account when calculating the set of pages
     // (PDF export UI does not allow for selecting left or right pages only)
@@ -726,11 +726,12 @@ void SwDoc::CalculatePagesForPrinting(
         // 4 -> print selection
         if (1 == nContent)
             aPageRange = rOptions.getStringValue( "PageRange" );
-        if (4 == nContent)
+
+        if (2 == nContent)
         {
             // note that printing selections is actually implemented by copying
             // the selection to a new temporary document and printing all of 
that one.
-            // Thus for Writer "PrintContent" must never be 4.
+            // Thus for Writer "PrintContent" must never be 2.
             // See SwXTextDocument::GetRenderDoc for evaluating if a selection 
is to be
             // printed and for creating the temporary document.
         }
@@ -913,9 +914,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
     // PageContent :
     // 0 -> print all pages (default if aPageRange is empty)
     // 1 -> print range according to PageRange
-    // 2 -> print even pages
-    // 3 -> print odd pages
-    // 4 -> print selection
+    // 2 -> print selection
     const sal_Int64 nContent = rOptions.getIntValue( "PrintContent", 0 );
     if (nContent == 1)
         aPageRange = rOptions.getStringValue( "PageRange" );
diff --git a/sw/source/core/view/printdata.cxx 
b/sw/source/core/view/printdata.cxx
index a27de833846c..5c24e1dd691d 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -176,8 +176,8 @@ SwPrintUIOptions::SwPrintUIOptions(
     // create sequence of print UI options
     // (5 options are not available for Writer-Web)
     const int nRTLOpts = bRTL ? 1 : 0;
-    const int nNumProps = nRTLOpts + (bWeb ? 14 : 18);
-    m_aUIProperties.resize( nNumProps );
+    const int nNumProps = nRTLOpts + (bWeb ? 15 : 19);
+    m_aUIProperties.resize( nNumProps);
     int nIdx = 0;
 
     // load the writer PrinterOptions into the custom tab
@@ -274,10 +274,10 @@ SwPrintUIOptions::SwPrintUIOptions(
 
     // create a choice for the content to create
     const OUString aPrintRangeName( "PrintContent" );
-    uno::Sequence< OUString > aChoices( 5 );
-    uno::Sequence< sal_Bool > aChoicesDisabled( 5 );
-    uno::Sequence< OUString > aHelpIds( 5 );
-    uno::Sequence< OUString > aWidgetIds( 5 );
+    uno::Sequence< OUString > aChoices( 3 );
+    uno::Sequence< sal_Bool > aChoicesDisabled( 3 );
+    uno::Sequence< OUString > aHelpIds( 3 );
+    uno::Sequence< OUString > aWidgetIds( 3 );
     aChoices[0] = SwResId( STR_PRINTOPTUI_PRINTALLPAGES );
     aChoicesDisabled[0] = false;
     aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0";
@@ -286,22 +286,14 @@ SwPrintUIOptions::SwPrintUIOptions(
     aChoicesDisabled[1] = false;
     aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1";
     aWidgetIds[1] = "rbRangePages";
-    aChoices[2] = SwResId( STR_PRINTOPTUI_PRINTEVENPAGES );
-    aChoicesDisabled[2] = false; //better disable for 1 page only
+    aChoices[2] = SwResId( STR_PRINTOPTUI_PRINTSELECTION );
+    aChoicesDisabled[2] = !bHasSelection;
     aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2";
-    aWidgetIds[2] = "rbEvenPages";
-    aChoices[3] = SwResId( STR_PRINTOPTUI_PRINTODDPAGES );
-    aChoicesDisabled[3] = false; //better disable for 1 page only
-    aHelpIds[3] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:3";
-    aWidgetIds[3] = "rbOddPages";
-    aChoices[4] = SwResId( STR_PRINTOPTUI_PRINTSELECTION );
-    aChoicesDisabled[4] = !bHasSelection;
-    aHelpIds[4] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:4";
-    aWidgetIds[4] = "rbRangeSelection";
+    aWidgetIds[2] = "rbRangeSelection";
     m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, 
OUString(),
                                                         aHelpIds, 
aPrintRangeName,
                                                         aChoices,
-                                                        bHasSelection ? 4 : 0,
+                                                        bHasSelection ? 2 : 0,
                                                         aChoicesDisabled);
 
     // show an Edit dependent on "Pages" selected
@@ -312,6 +304,16 @@ SwPrintUIOptions::SwPrintUIOptions(
                                                       OUString::number( 
nCurrentPage ) /* set text box to current page number */,
                                                       aPageRangeOpt);
 
+    vcl::PrinterOptionsHelper::UIControlOptions aEvenOddOpt(aPrintRangeName, 
-1, true);
+    m_aUIProperties[ nIdx++ ].Value = setChoiceListControlOpt("evenoddbox",
+                                                           OUString(),
+                                                           
uno::Sequence<OUString>(),
+                                                           "EvenOdd",
+                                                           
uno::Sequence<OUString>(),
+                                                           0,
+                                                           uno::Sequence< 
sal_Bool >(),
+                                                           aEvenOddOpt);
+
     // create a list box for notes content
     const SwPostItMode nPrintPostIts = rDefaultPrintData.GetPrintPostIts();
     aChoices.realloc( 5 );
@@ -385,9 +387,9 @@ bool SwPrintUIOptions::IsPrintLeftPages() const
     // 0: left and right pages
     // 1: left pages only
     // 2: right pages only
-    sal_Int64 nLRPages = getIntValue( "PrintContent", 0 /* default: all */ );
-    bool bRes = nLRPages != 3;
-    bRes = getBoolValue( "PrintContent", bRes /* <- default value if property 
is not found */ );
+    sal_Int64 nEOPages = getIntValue( "EvenOdd", 0 /* default: all */ );
+    bool bRes = nEOPages != 2;
+    bRes = getBoolValue( "EvenOdd", bRes /* <- default value if property is 
not found */ );
     return bRes;
 }
 
@@ -396,9 +398,9 @@ bool SwPrintUIOptions::IsPrintRightPages() const
     // take care of different property names for the option.
     // for compatibility the old name should win (may still be used for PDF 
export or via Uno API)
 
-    sal_Int64 nLRPages = getIntValue( "PrintContent", 0 /* default: all */ );
-    bool bRes = nLRPages != 2;
-    bRes = getBoolValue( "PrintContent", bRes /* <- default value if property 
is not found */ );
+    sal_Int64 nEOPages = getIntValue( "EvenOdd", 0 /* default: all */ );
+    bool bRes = nEOPages != 1;
+    bRes = getBoolValue( "EvenOdd", bRes /* <- default value if property is 
not found */ );
     return bRes;
 }
 
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index 94d1c64181ec..5cd2dfd4553b 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -540,14 +540,12 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <object class="GtkRadioButton" 
id="rbEvenPages">
-                                                <property name="label" 
translatable="yes" context="printdialog|rmEvenPages">_Even pages</property>
-                                                <property 
name="visible">True</property>
+                                              <object class="GtkRadioButton" 
id="rbRangeSelection">
+                                                <property name="label" 
translatable="yes" context="printdialog|rbRangeSelection">_Selection</property>
                                                 <property 
name="can_focus">True</property>
                                                 <property 
name="receives_default">False</property>
                                                 <property 
name="halign">start</property>
                                                 <property 
name="margin_top">2</property>
-                                                <property 
name="margin_bottom">2</property>
                                                 <property 
name="use_underline">True</property>
                                                 <property 
name="draw_indicator">True</property>
                                                 <property 
name="group">rbAllPages</property>
@@ -559,39 +557,34 @@
                                               </packing>
                                             </child>
                                             <child>
-                                              <object class="GtkRadioButton" 
id="rbOddPages">
-                                                <property name="label" 
translatable="yes" context="printdialog|rbOddPages">_Odd pages</property>
+                                              <object class="GtkLabel" 
id="includeevenodd">
                                                 <property 
name="visible">True</property>
-                                                <property 
name="can_focus">True</property>
-                                                <property 
name="receives_default">False</property>
+                                                <property 
name="can_focus">False</property>
                                                 <property 
name="halign">start</property>
-                                                <property 
name="margin_top">2</property>
-                                                <property 
name="margin_bottom">2</property>
+                                                <property name="label" 
translatable="yes" context="printdialog|includeevenodd">Include:</property>
                                                 <property 
name="use_underline">True</property>
-                                                <property 
name="draw_indicator">True</property>
-                                                <property 
name="group">rbAllPages</property>
+                                                <property 
name="mnemonic_widget">evenoddbox</property>
                                               </object>
                                               <packing>
                                                 <property 
name="left_attach">0</property>
                                                 <property 
name="top_attach">3</property>
-                                                <property 
name="width">2</property>
                                               </packing>
                                             </child>
                                             <child>
-                                              <object class="GtkRadioButton" 
id="rbRangeSelection">
-                                                <property name="label" 
translatable="yes" context="printdialog|rbRangeSelection">_Selection</property>
-                                                <property 
name="can_focus">True</property>
-                                                <property 
name="receives_default">False</property>
-                                                <property 
name="halign">start</property>
-                                                <property 
name="margin_top">2</property>
-                                                <property 
name="use_underline">True</property>
-                                                <property 
name="draw_indicator">True</property>
-                                                <property 
name="group">rbAllPages</property>
+                                              <object class="GtkComboBoxText" 
id="evenoddbox">
+                                                <property 
name="visible">True</property>
+                                                <property 
name="can_focus">False</property>
+                                                <property 
name="hexpand">True</property>
+                                                <property 
name="active">0</property>
+                                                <items>
+                                                  <item translatable="yes" 
context="printdialog|liststore3">Even and Odd Pages</item>
+                                                  <item translatable="yes" 
context="printdialog|liststore3">Even Pages</item>
+                                                  <item translatable="yes" 
context="printdialog|liststore3">Odd Pages</item>
+                                                </items>
                                               </object>
                                               <packing>
-                                                <property 
name="left_attach">0</property>
-                                                <property 
name="top_attach">4</property>
-                                                <property 
name="width">2</property>
+                                                <property 
name="left_attach">1</property>
+                                                <property 
name="top_attach">3</property>
                                               </packing>
                                             </child>
                                           </object>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to