diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-09-16 17:27:35 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-08-02 16:17:50 -0400 |
commit | 5116ec373c0a7c65f8bf8ace182d0cb4151288c0 (patch) | |
tree | bf767a4dc9951dbfc51a40e4954c80de304891eb /sd | |
parent | 86073d788fb1834a8e99aae0478d9ce7f63fec52 (diff) |
LOK: support for ordering/moving parts
Currently reordering of slides is only supported
for presentations, although it is provisioned for
spreadsheets as well.
Change-Id: I6c35066d6a5ef7586d34a8e8b89db69a20b86572
Reviewed-on: https://gerrit.libreoffice.org/69612
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/73495
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 5 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 25 |
2 files changed, 29 insertions, 1 deletions
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index f8a6f50be604..f271d7b37b69 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -264,7 +264,10 @@ public: virtual OUString getPostIts() override; /// @see vcl::ITiledRenderable::selectPart(). virtual void selectPart(int nPart, int nSelect) override; - + /// @see vcl::ITiledRenderable::moveSelectedParts(). + virtual void moveSelectedParts(int nPosition, bool bDuplicate) override; + /// @see vcl::ITiledRenderable::getPartInfo(). + virtual OUString getPartInfo(int nPart) override; // XComponent diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index aeaf03c9f112..fbefc1c7e0bf 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2291,6 +2291,31 @@ void SdXImpressDocument::selectPart(int nPart, int nSelect) pViewSh->SelectPage(nPart, nSelect); } +void SdXImpressDocument::moveSelectedParts(int nPosition, bool bDuplicate) +{ + // Duplicating is currently unsupported. + if (!bDuplicate) + mpDoc->MovePages(nPosition); +} + +OUString SdXImpressDocument::getPartInfo(int nPart) +{ + DrawViewShell* pViewSh = GetViewShell(); + if (!pViewSh) + return OUString(); + + OUString aPartInfo; + const bool bIsVisible = pViewSh->IsVisible(nPart); + const bool bIsSelected = pViewSh->IsSelected(nPart); + + aPartInfo += "{ \"visible\": \""; + aPartInfo += OUString::number(static_cast<unsigned int>(bIsVisible)); + aPartInfo += "\", \"selected\": \""; + aPartInfo += OUString::number(static_cast<unsigned int>(bIsSelected)); + aPartInfo += "\" }"; + return aPartInfo; +} + void SdXImpressDocument::setPart( int nPart ) { DrawViewShell* pViewSh = GetViewShell(); |