diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-09-11 08:11:47 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-07-10 15:32:53 +0200 |
commit | 74d56d44804efa3424cff3434d2baf00c60b3cd5 (patch) | |
tree | 0a67b6ff20180882d5d01a00845721877d52ab60 /sd/source | |
parent | 5583ee37101a748d901fae1da315aeb453278ecd (diff) |
slide-sorter: multiple selection
Change-Id: I8624de25b0bb66020002890f33758e52059a24ab
Reviewed-on: https://gerrit.libreoffice.org/69610
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/73493
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/inc/DrawViewShell.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 46 |
4 files changed, 60 insertions, 0 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 64bcabc7cc9c..7d4ea407175a 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -247,6 +247,8 @@ public: bool SwitchPage(sal_uInt16 nPage); bool IsSwitchPageAllowed() const; + bool SelectPage(sal_uInt16 nPage, sal_uInt16 nSelect); + void GotoBookmark(const OUString& rBookmark); //Realize multi-selection of objects, If object is marked, the //corresponding entry is set true, else the corresponding entry is set diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 2be081b447f1..4d712f69a503 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -263,6 +263,9 @@ public: virtual PointerStyle getPointer() override; /// @see vcl::ITiledRenderable::getPostIts(). virtual OUString getPostIts() override; + /// @see vcl::ITiledRenderable::selectPart(). + virtual void selectPart(int nPart, int nSelect) override; + // XComponent diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index e26670b321e4..6329f2a4bf97 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2273,6 +2273,15 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice, nTilePosX, nTilePosY, nTileWidth, nTileHeight); } +void SdXImpressDocument::selectPart(int nPart, int nSelect) +{ + DrawViewShell* pViewSh = GetViewShell(); + if (!pViewSh) + return; + + pViewSh->SelectPage(nPart, nSelect); +} + void SdXImpressDocument::setPart( int nPart ) { DrawViewShell* pViewSh = GetViewShell(); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index e72080fe00fd..b725833c7b3c 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -79,6 +79,10 @@ #include <LayerTabBar.hxx> #include <ViewShellManager.hxx> #include <ViewShellHint.hxx> +#include <SlideSorter.hxx> +#include <SlideSorterViewShell.hxx> +#include <controller/SlideSorterController.hxx> +#include <controller/SlsPageSelector.hxx> #include <sfx2/request.hxx> #include <comphelper/lok.hxx> @@ -765,6 +769,48 @@ bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) } /** + * Mark the desired page as selected (1), deselected (0), toggle (2). + * nPage refers to the page in question. + */ +bool DrawViewShell::SelectPage(sal_uInt16 nPage, sal_uInt16 nSelect) +{ + bool bOK = false; + + // Tell the slide sorter about the name change (necessary for + // accessibility.) + slidesorter::SlideSorterViewShell* pSlideSorterViewShell + = slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase()); + if (pSlideSorterViewShell != nullptr) + { + slidesorter::controller::PageSelector& aPageSelector + = pSlideSorterViewShell->GetSlideSorter().GetController().GetPageSelector(); + if (nSelect == 0) + { + // Deselect. + aPageSelector.DeselectPage(nPage); + bOK = true; + } + else if (nSelect == 1) + { + // Select. + aPageSelector.SelectPage(nPage); + bOK = true; + } + else + { + // Toggle. + if (aPageSelector.IsPageSelected(nPage)) + aPageSelector.DeselectPage(nPage); + else + aPageSelector.SelectPage(nPage); + bOK = true; + } + } + + return bOK; +} + +/** * Switch to desired page. * nSelectPage refers to the current EditMode */ |