diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-18 12:10:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-18 12:54:38 +0100 |
commit | db00223e6d3132eac9603e5dabd20cd03f599cb3 (patch) | |
tree | 34dc35e6ef167a0a9f25470fefc6a6e766825fae /sd/source | |
parent | bb3671180eb7327be9ac178e0d8341322f63d72a (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
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/core/drawdoc2.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 5 |
2 files changed, 15 insertions, 0 deletions
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 ) { |