diff options
author | Srijan Bhatia <srijanbhatiasun@gmail.com> | 2020-06-18 18:41:14 +0530 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-02 12:12:02 +0200 |
commit | 14b8c176133979cd1c3163ef5fe3eed0e6479fea (patch) | |
tree | f4f269904c4187336ceb13113a71154d49988bb8 /sd | |
parent | 445537bbc2971b970bed244db40f35c9caf43ef4 (diff) |
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.tietze@documentfoundation.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/DocumentRenderer.hrc | 4 | ||||
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 26 |
2 files changed, 13 insertions, 17 deletions
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 ) |