Kaydet (Commit) db00223e authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst bb367118
......@@ -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);
......
......@@ -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
......
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment