include/vcl/gdimtf.hxx    |    1 -
 vcl/source/gdi/gdimtf.cxx |    4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

New commits:
commit b1cfbdf60e242930b0f2396dd9a8b29eb24aa36e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Nov 15 12:58:50 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Nov 15 13:47:19 2024 +0100

    simplify GDIMetaFile::ReplaceAction
    
    now that we are using proper reference-counting template classes to
    control lifetime here, the code can be simplified and obsolete comments
    removed.
    
    Change-Id: I7693c684d4bed0e26016b5d6bbbf1c38fec62519
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176624
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index d3a0c95c1b17..2b24745ede9a 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -163,7 +163,6 @@ public:
     void            AddAction(const rtl::Reference<MetaAction>& pAction, 
size_t nPos);
     SAL_DLLPRIVATE void push_back(const rtl::Reference<MetaAction>& pAction);
     /**
-     * @param pAction takes ownership
      * @param nAction the action to replace
      */
     SAL_DLLPRIVATE void ReplaceAction( rtl::Reference<MetaAction> pAction, 
size_t nAction );
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 9f0da0bc821d..c127d889e6a2 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -205,9 +205,7 @@ void GDIMetaFile::ReplaceAction( rtl::Reference<MetaAction> 
pAction, size_t nAct
     {
         return;
     }
-    //fdo#39995 This doesn't increment the incoming action ref-count nor does 
it
-    //decrement the outgoing action ref-count
-    std::swap(pAction, m_aList[nAction]);
+    m_aList[nAction] = std::move(pAction);
 }
 
 GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )

Reply via email to