From cc620755fe8fae728d6db23f13ddabc8f8feda6d Mon Sep 17 00:00:00 2001 From: David Tardon Date: Jan 25 2016 20:18:30 +0000 Subject: Resolves: rhbz#1168757 Selecting multiple slides is not reflected in Print dialog --- diff --git a/0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch b/0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch new file mode 100644 index 0000000..91e55e0 --- /dev/null +++ b/0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch @@ -0,0 +1,111 @@ +From 6184f8debb94571c11ab085ccbc5f431459fe1d5 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Wed, 20 Jan 2016 18:40:06 +0100 +Subject: [PATCH] rhbz#1168757 propagate selected slides to print dialog + +(cherry picked from commit f90f8329fe5e95f25ba449e307fd40d56d68d3bb) + +Change-Id: Icef119baffb8985ea0cb94d7e59f0daae88023ac +--- + sd/source/ui/view/DocumentRenderer.cxx | 41 ++++++++++++++++++++++++++++++---- + 1 file changed, 37 insertions(+), 4 deletions(-) + +diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx +index 734c61a..8924468 100644 +--- a/sd/source/ui/view/DocumentRenderer.cxx ++++ b/sd/source/ui/view/DocumentRenderer.cxx +@@ -33,10 +33,12 @@ + #include "FrameView.hxx" + #include "Outliner.hxx" + #include "OutlineViewShell.hxx" ++#include "SlideSorterViewShell.hxx" + + #include + #include + #include ++#include + #include + #include + #include +@@ -333,8 +335,9 @@ namespace { + class DialogCreator : Resource + { + public: +- DialogCreator (bool bImpress, sal_Int32 nCurPage) ++ DialogCreator (ViewShellBase &rBase, bool bImpress, sal_Int32 nCurPage) + : Resource(SdResId(_STR_IMPRESS_PRINT_UI_OPTIONS)) ++ , mrBase(rBase) + , mbImpress(bImpress) + , mnCurPage(nCurPage) + { +@@ -359,6 +362,7 @@ namespace { + } + + private: ++ ViewShellBase &mrBase; + ::std::vector maProperties; + ::std::vector maSlidesPerPage; + bool mbImpress; +@@ -584,19 +588,48 @@ namespace { + aWidgetIds[0] = "printallpages"; + aWidgetIds[1] = "printpages"; + aWidgetIds[2] = "printselection"; ++ ++ // check if there is a selection of slides ++ OUString aPageRange(OUString::number(mnCurPage + 1)); ++ int nPrintRange(0); ++ using sd::slidesorter::SlideSorterViewShell; ++ SlideSorterViewShell* const pSSViewSh(SlideSorterViewShell::GetSlideSorter(mrBase)); ++ if (pSSViewSh) ++ { ++ const std::shared_ptr pPageSelection(pSSViewSh->GetPageSelection()); ++ if (bool(pPageSelection) && pPageSelection->size() > 1) ++ { ++ OUStringBuffer aBuf; ++ // TODO: this could be improved by writing ranges instead of consecutive page ++ // numbers if appropriate. Do we have a helper function for that somewhere? ++ bool bFirst(true); ++ for (auto pPage: *pPageSelection) ++ { ++ if (!bFirst) ++ { ++ aBuf.append(','); ++ bFirst = false; ++ } ++ aBuf.append(OUString::number(pPage->GetPageNum() / 2 + 1)); ++ } ++ aPageRange = aBuf.getStr(); ++ nPrintRange = 1; ++ } ++ } ++ + AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt(aWidgetIds, "", + aHelpIds, + aPrintRangeName, + CreateChoice(mbImpress + ? _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE + : _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE), +- 0 ) ++ nPrintRange ) + ); + // create a an Edit dependent on "Pages" selected + vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, true ); + AddDialogControl(vcl::PrinterOptionsHelper::setEditControlOpt("pagerange", "", + ".HelpID:vcl:PrintDialog:PageRange:Edit", "PageRange", +- OUString::number(mnCurPage + 1), aPageRangeOpt)); ++ aPageRange, aPageRangeOpt)); + + FreeResource(); + } +@@ -1140,7 +1173,7 @@ public: + , mpPrintView() + , mbHasOrientationWarningBeenShown(false) + { +- DialogCreator aCreator( mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS, GetCurrentPageIndex() ); ++ DialogCreator aCreator( mrBase, mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS, GetCurrentPageIndex() ); + m_aUIProperties = aCreator.GetDialogControls(); + maSlidesPerPage = aCreator.GetSlidesPerPage(); + +-- +2.5.0 + diff --git a/libreoffice.spec b/libreoffice.spec index a8318d0..c2143a0 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -53,7 +53,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.1 -Release: 2%{?libo_prerelease}%{?dist} +Release: 3%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0 Group: Applications/Productivity URL: http://www.libreoffice.org/ @@ -376,6 +376,7 @@ Patch67: 0001-Resolves-rhbz-1257635-after-httpConnectEncrypt-use-c.patch Patch68: 0001-rerun-autoconf-after-remove-BOOST_SYSTEM.patch Patch69: 0001-valgrind-memleak-on-thrown-exception.patch Patch70: 0002-valgrind-memleak-on-thrown-exception.patch +Patch71: 0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2497,6 +2498,10 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Mon Jan 25 2016 David Tardon - 1:5.0.5.1-3-UNBUILT +- Resolves: rhbz#1168757 Selecting multiple slides is not reflected in Print + dialog + * Fri Jan 22 2016 Caolán McNamara - 1:5.0.5.1-2 - Resolves: rhbz#1257635 after httpConnectEncrypt use cupsGetDests2