[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sd/source

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 10 10:31:45 UTC 2020


 sd/source/ui/view/drviews4.cxx |   27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

New commits:
commit 6f43db55ab72a3a538bf9ca0aeecb31fc1abbee1
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Tue May 26 10:20:07 2020 +0530
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Jun 10 12:31:13 2020 +0200

    LOK: Allow deleting multiple slides from slidesorter
    
    Change-Id: Ie371e7eb5a96655fd281b4137243aa8628b6283b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94714
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 70d49670ea7d..20ec54212c5a 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -73,16 +73,33 @@ using namespace ::com::sun::star::drawing;
 
 void DrawViewShell::DeleteActualPage()
 {
-    sal_uInt16          nPage = maTabControl->GetCurPagePos();
-
     mpDrawView->SdrEndTextEdit();
 
     try
     {
         Reference<XDrawPagesSupplier> xDrawPagesSupplier( GetDoc()->getUnoModel(), UNO_QUERY_THROW );
-        Reference<XDrawPages> xPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW );
-        Reference< XDrawPage > xPage( xPages->getByIndex( nPage ), UNO_QUERY_THROW );
-        xPages->remove( xPage );
+        Reference<XDrawPages> xPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
+        sal_uInt16 nPageCount   = GetDoc()->GetSdPageCount(mePageKind);
+        SdPage* pPage = nullptr;
+        std::vector<Reference<XDrawPage>> pagesToDelete;
+
+        GetView()->BegUndo(SdResId(STR_UNDO_DELETEPAGES));
+
+        for (sal_uInt16 i = 0; i < nPageCount; i++)
+        {
+            pPage = GetDoc()->GetSdPage(i, mePageKind);
+            if(pPage->IsSelected())
+            {
+                Reference< XDrawPage > xPage( xPages->getByIndex( maTabControl->GetPagePos(pPage->getPageId()) ), UNO_QUERY_THROW );
+                pagesToDelete.push_back(xPage);
+            }
+        }
+        for (auto &xPage: pagesToDelete)
+        {
+            xPages->remove(xPage);
+        }
+
+        GetView()->EndUndo();
     }
     catch( Exception& )
     {


More information about the Libreoffice-commits mailing list