summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-09-11 08:11:47 -0400
committerAshod Nakashian <ashnakash@gmail.com>2019-04-15 02:30:30 +0200
commit6597c9be98b5058c028e980cfc6681a7fd09147d (patch)
tree9a6f9156d913bed30cfdec18ad98a184a6d94831 /sd
parent8286ce93454e39d5669a381cb1785392ad7e43f3 (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>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx2
-rw-r--r--sd/source/ui/inc/unomodel.hxx3
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx9
-rw-r--r--sd/source/ui/view/drviews1.cxx46
4 files changed, 60 insertions, 0 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 17587ac5be1e..bda391f71858 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -245,6 +245,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 586f3279e06b..054f7ffa8b9a 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -265,6 +265,9 @@ public:
virtual Pointer 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 5eb8192a4e5b..44c84af76fee 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2289,6 +2289,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 976d8dd1cb7b..369ab276bbe2 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -77,6 +77,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>
@@ -744,6 +748,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
*/