35#include <drawview.hxx>
38#include <svx/svxids.hrc>
39#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
40#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
59 mnInsertionPosition(-1),
85 ::std::vector<SdPage*> aSelectedPages;
86 sal_Int32 nNewCurrentSlide (-1);
90 aSelectedPages.push_back(pDescriptor->GetPage());
91 if (bSelectFollowingPage || nNewCurrentSlide<0)
92 nNewCurrentSlide = pDescriptor->GetPageIndex();
94 if (aSelectedPages.empty())
99 if (bSelectFollowingPage)
100 nNewCurrentSlide -= aSelectedPages.size() - 1;
105 const auto pDrawViewShell = pViewShell ? std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell->GetViewShellBase().GetMainViewShell()) :
nullptr;
106 const auto pDrawView = pDrawViewShell ? pDrawViewShell->GetDrawView() :
nullptr;
109 pDrawView->BlockPageOrderChangedHint(
true);
112 OUString sUndoComment(
SdResId(STR_UNDO_DELETEPAGES));
114 sUndoComment =
SdResId(STR_UNDO_DELETEPAGES_DRAW);
130 assert(pDrawViewShell);
131 pDrawView->BlockPageOrderChangedHint(
false);
132 pDrawViewShell->ResetActualPage();
140 if (nNewCurrentSlide < 0)
141 nNewCurrentSlide = 0;
157 Reference<drawing::XDrawPages> xPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
163 ::std::vector<SdPage*>::const_reverse_iterator aI;
164 for (aI=rSelectedPages.rbegin(); aI!=rSelectedPages.rend(); ++aI)
167 if (xPages->getCount() <= 1)
172 Reference< XDrawPage > xPage( xPages->getByIndex( nPage ), UNO_QUERY_THROW );
173 xPages->remove(xPage);
190 Reference<drawing::XDrawPages> xPages( xDrawPagesSupplier->getMasterPages(), UNO_SET_THROW );
196 ::std::vector<SdPage*>::const_reverse_iterator aI;
197 for (aI=rSelectedPages.rbegin(); aI!=rSelectedPages.rend(); ++aI)
200 if (xPages->getCount() <= 1)
205 Reference< XDrawPage > xPage( xPages->getByIndex( nPage ), UNO_QUERY_THROW );
206 xPages->remove(xPage);
218 if (pViewShell ==
nullptr)
226 pViewShell->
Invalidate(SID_DELETE_MASTER_PAGE);
273 if (nInsertionPosition < 0)
283 const sal_Int32 nPosition (aSelectedPages.
GetNextElement()->GetPage()->GetPageNum());
290 return nInsertionPosition;
295 if (nInsertionPosition < 0)
SlideSorterController & mrController
SlideSorter & mrSlideSorter
SAL_DLLPRIVATE DocumentType GetDocumentType() const
css::uno::Reference< css::uno::XInterface > const & getUnoModel()
virtual void Invalidate(sal_uInt16 nId=0)
Base class of the stacked shell hierarchy.
virtual void UpdatePreview(SdPage *pPage)
This method is still used by the OutlineViewShell to update the model according to the content of the...
SdDrawDocument & GetDoc() const
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
ViewShell * GetViewShell() const
Return the view shell that was given at construction.
model::SlideSorterModel & GetModel() const
view::SlideSorterView & GetView() const
bool ToggleFocus()
Toggle the focused state of the current slide.
bool SetFocusedPage(const model::SharedPageDescriptor &rDescriptor)
Set the focused page to the one described by the given page descriptor.
bool IsFocusShowing() const
Return <TRUE> when the focus indicator is currently shown.
Use the UpdateLock whenever you do a complex selection, i.e.
void CountSelectedPages()
Call this method after the model has changed to set the number of selected pages.
void SelectPage(int nPageIndex)
Select the specified descriptor.
void SetInsertionPosition(const sal_Int32 nInsertionPosition)
Store an insertion position temporarily.
SlideSorterController & mrController
void AddSelectionChangeListener(const Link< LinkParamNone *, void > &rListener)
Add a listener that is called when the selection of the slide sorter changes.
sal_Int32 mnInsertionPosition
The insertion position is only temporarily valid.
sal_Int32 GetInsertionPosition() const
Return the position where to insert pasted slides based on the current selection.
void DeleteSelectedMasterPages(const ::std::vector< SdPage * > &rSelectedMasterPages)
Delete the given list of master pages.
void DeleteSelectedPages(const bool bSelectFollowingPage=true)
Delete the currently selected slides.
void SelectionHasChanged()
Call this method after the selection has changed (possible several calls to the PageSelector) to inva...
void RemoveSelectionChangeListener(const Link< LinkParamNone *, void > &rListener)
Remove a listener that was called when the selection of the slide sorter changes.
::std::vector< Link< LinkParamNone *, void > > maSelectionChangeListeners
SelectionManager(SlideSorter &rSlideSorter)
Create a new SelectionManager for the given slide sorter.
void DeleteSelectedNormalPages(const ::std::vector< SdPage * > &rSelectedNormalPages)
Delete the given list of normal pages.
SlideSorter & mrSlideSorter
Observe insertions and deletions of pages between calls to StartObservation() and EndObservation().
Create an object of this inner class to prevent updates due to model changes.
void HandleModelChange()
Handle a change of the model, that is, handle the removal and insertion of whole pages or a change of...
FocusManager & GetFocusManager()
std::shared_ptr< CurrentSlideManager > const & GetCurrentSlideManager() const
SD_DLLPUBLIC PageSelector & GetPageSelector()
static PageEnumeration CreateSelectedPagesEnumeration(const SlideSorterModel &rModel)
The returned enumeration of slides iterates over the currently selected slides of the given model.
Public class of page enumerations that delegates its calls to an implementation object that can filte...
virtual SharedPageDescriptor GetNextElement() override
Return the next element of the enumeration.
virtual bool HasMoreElements() const override
Return <TRUE> when the enumeration has more elements, i.e.
SdDrawDocument * GetDocument()
This method is present to let the view create a ShowView for displaying slides.
sal_Int32 GetPageCount() const
Return the number of slides in the document regardless of whether they are visible or not or whether ...
EditMode GetEditMode() const
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual std::shared_ptr< SfxDialogController > GetController() override
std::shared_ptr< T > make_shared(Args &&... args)
sal_Int32 FromCoreIndex(const sal_uInt16 nCoreIndex)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
OUString SdResId(TranslateId aId)