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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu May 27 11:13:53 UTC 2021


 svx/source/svdraw/MediaShellHelpers.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 5a0be5e55914d5aba197170894bfed1b6be8b876
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu May 27 11:43:02 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu May 27 13:13:14 2021 +0200

    no need to make copies here
    
    Change-Id: If3cd60bd48f640c353fd4c28449faed2cdcebdda
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116243
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svx/source/svdraw/MediaShellHelpers.cxx b/svx/source/svdraw/MediaShellHelpers.cxx
index 03fb24174e7b..4ea2f2325c2d 100644
--- a/svx/source/svdraw/MediaShellHelpers.cxx
+++ b/svx/source/svdraw/MediaShellHelpers.cxx
@@ -41,12 +41,12 @@ void GetState(SdrMarkView* pSdrView, SfxItemSet& rSet)
         if (SID_AVMEDIA_TOOLBOX != nWhich)
             continue;
 
-        std::unique_ptr<SdrMarkList> pMarkList(new SdrMarkList(pSdrView->GetMarkedObjectList()));
+        const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
         bool bDisable = true;
 
-        if (1 == pMarkList->GetMarkCount())
+        if (1 == rMarkList.GetMarkCount())
         {
-            SdrObject* pObj = pMarkList->GetMark(0)->GetMarkedSdrObj();
+            SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
 
             if (dynamic_cast<SdrMediaObj*>(pObj))
             {
@@ -81,12 +81,12 @@ const ::avmedia::MediaItem* Execute(SdrMarkView* pSdrView, SfxRequest const& rRe
     if (!pItem)
         return nullptr;
 
-    std::unique_ptr<SdrMarkList> pMarkList(new SdrMarkList(pSdrView->GetMarkedObjectList()));
+    const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
 
-    if (1 != pMarkList->GetMarkCount())
+    if (1 != rMarkList.GetMarkCount())
         return nullptr;
 
-    SdrObject* pObj = pMarkList->GetMark(0)->GetMarkedSdrObj();
+    SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
 
     if (!dynamic_cast<SdrMediaObj*>(pObj))
         return nullptr;


More information about the Libreoffice-commits mailing list