summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-18 12:10:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-18 12:54:38 +0100
commitdb00223e6d3132eac9603e5dabd20cd03f599cb3 (patch)
tree34dc35e6ef167a0a9f25470fefc6a6e766825fae
parentbb3671180eb7327be9ac178e0d8341322f63d72a (diff)
Related: tdf#99523 select only the desired slides
when selecting the same slides in the document as are selected in the slide pane, don't forget to unselect any slides already selected in the document. impress is nuts in carrying around two selection mechanisms. Change-Id: I97d744c1c57b68dc312a17a5cd5290e1b6ccf083
-rw-r--r--sd/inc/drawdoc.hxx1
-rw-r--r--sd/source/core/drawdoc2.cxx10
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx5
3 files changed, 16 insertions, 0 deletions
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index bf5e0db7429f..476be4de258e 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -363,6 +363,7 @@ public:
sal_uInt16 GetSdPageCount(PageKind ePgKind) const;
SAL_DLLPRIVATE void SetSelected(SdPage* pPage, bool bSelect);
+ SAL_DLLPRIVATE void UnselectAllPages();
SAL_DLLPRIVATE bool MovePages(sal_uInt16 nTargetPage);
SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 68f3b91feb4d..200f613f4972 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -696,6 +696,16 @@ bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
return bOK;
}
+void SdDrawDocument::UnselectAllPages()
+{
+ sal_uInt16 nNoOfPages = GetSdPageCount(PK_STANDARD);
+ for (sal_uInt16 nPage = 0; nPage < nNoOfPages; ++nPage)
+ {
+ SdPage* pPage = GetSdPage(nPage, PK_STANDARD);
+ pPage->SetSelected(false);
+ }
+}
+
// + Move selected pages after said page
// (nTargetPage = (sal_uInt16)-1 --> move before first page)
// + Returns sal_True when the page has been moved
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index dbc53f2bc260..24fab760d082 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -718,6 +718,7 @@ void SlideSorterViewShell::ExecMovePageFirst (SfxRequest& /*rReq*/)
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages (*it)
+ GetDoc()->UnselectAllPages();
std::shared_ptr<SlideSorterViewShell::PageSelection> pSelection ( GetPageSelection() );
for (auto it = pSelection->begin(); it != pSelection->end() ; ++it ) {
GetDoc()->SetSelected(*it, true);
@@ -769,6 +770,7 @@ void SlideSorterViewShell::ExecMovePageUp (SfxRequest& /*rReq*/)
sal_uInt16 pageNo;
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages (*it)
+ GetDoc()->UnselectAllPages();
std::shared_ptr<SlideSorterViewShell::PageSelection> pSelection ( GetPageSelection() );
for (auto it = pSelection->begin(); it != pSelection->end() ; ++it ) {
// Check page number
@@ -803,6 +805,7 @@ void SlideSorterViewShell::ExecMovePageDown (SfxRequest& /*rReq*/)
sal_uInt16 pageNo;
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages (*it)
+ GetDoc()->UnselectAllPages();
std::shared_ptr<SlideSorterViewShell::PageSelection> pSelection ( GetPageSelection() );
for (auto it = pSelection->begin(); it != pSelection->end() ; ++it )
{
@@ -837,6 +840,7 @@ void SlideSorterViewShell::ExecMovePageLast (SfxRequest& /*rReq*/)
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages (*it)
+ GetDoc()->UnselectAllPages();
std::shared_ptr<SlideSorterViewShell::PageSelection> pSelection ( GetPageSelection() );
for (auto it = pSelection->begin(); it != pSelection->end() ; ++it ) {
GetDoc()->SetSelected(*it, true);
@@ -866,6 +870,7 @@ void SlideSorterViewShell::GetStateMovePageLast (SfxItemSet& rSet)
sal_uInt16 pageNo;
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages (*it)
+ GetDoc()->UnselectAllPages();
std::shared_ptr<SlideSorterViewShell::PageSelection> pSelection ( GetPageSelection() );
for (auto it = pSelection->begin(); it != pSelection->end() ; ++it )
{