[Libreoffice-commits] core.git: sd/source

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 25 06:11:11 UTC 2020


 sd/source/ui/view/drviews4.cxx |   25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 4acb7b9249206aadaf4617a2abf3ac6d57d62079
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Tue May 26 10:20:07 2020 +0530
Commit:     Pranam Lashkari <lpranam at collabora.com>
CommitDate: Thu Jun 25 08:10:33 2020 +0200

    LOK: Allow deleting multiple slides from slidesorter
    
    Change-Id: Ie371e7eb5a96655fd281b4137243aa8628b6283b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94816
    Tested-by: Jenkins
    Reviewed-by: Pranam Lashkari <lpranam at collabora.com>

diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 9839d3d799e5..5cd99a497143 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -72,16 +72,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_SET_THROW );
-        Reference< XDrawPage > xPage( xPages->getByIndex( nPage ), UNO_QUERY_THROW );
-        xPages->remove( xPage );
+        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