dbaccess/source/core/inc/definitioncontainer.hxx         |    2 +-
 drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx |   10 +++-------
 svx/source/unodraw/unopage.cxx                           |    3 +--
 sw/source/core/unocore/unodraw.cxx                       |    3 +--
 toolkit/source/controls/eventcontainer.cxx               |    3 +--
 5 files changed, 7 insertions(+), 14 deletions(-)

New commits:
commit ae117fe829ad744a98231dc992a7c1692b591c9d
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Dec 12 10:57:52 2023 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Dec 12 17:11:48 2023 +0100

    cid#1546444 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1546389 COPY_INSTEAD_OF_MOVE
    cid#1546388 COPY_INSTEAD_OF_MOVE
    cid#1546360 COPY_INSTEAD_OF_MOVE
    cid#1546158 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I3707d55b88674dfb5ae786fc2cc45000862340de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160611
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx 
b/dbaccess/source/core/inc/definitioncontainer.hxx
index 9c871601ad6f..02f145776c8f 100644
--- a/dbaccess/source/core/inc/definitioncontainer.hxx
+++ b/dbaccess/source/core/inc/definitioncontainer.hxx
@@ -130,7 +130,7 @@ protected:
         with a new one), this new element must pass our own internal approval, 
plus the approval
         given here.
     */
-    void                setElementApproval( PContainerApprove 
_pElementApproval ) { m_pElementApproval = _pElementApproval; }
+    void setElementApproval(const PContainerApprove& _pElementApproval ) { 
m_pElementApproval = _pElementApproval; }
     const PContainerApprove& getElementApproval() const { return 
m_pElementApproval; }
 
 protected:
diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx 
b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
index 1211e21c718f..e575c4279b24 100644
--- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
@@ -52,12 +52,10 @@ namespace drawinglayer::primitive2d
                         aObjectTransform.set(0, 2, 
getLocalObjectRange().getMinX());
                         aObjectTransform.set(1, 2, 
getLocalObjectRange().getMinY());
 
-                        Primitive2DReference xReference(
+                        aRetval.set(
                             new BitmapPrimitive2D(
                                 getBitmapEx(),
                                 aObjectTransform));
-
-                        aRetval = xReference;
                     }
                     else
                     {
@@ -151,11 +149,10 @@ namespace drawinglayer::primitive2d
                             aObjectTransform.set(0, 2, aTargetRange.getMinX());
                             aObjectTransform.set(1, 2, aTargetRange.getMinY());
 
-                            Primitive2DReference xReference(
+                            aRetval.set(
                                 new BitmapPrimitive2D(
                                     getBitmapEx(),
                                     aObjectTransform));
-                            aRetval = xReference;
 
                             // clip when not completely inside object range
                             bNeedsClipping = 
!getLocalObjectRange().isInside(aTargetRange);
@@ -188,11 +185,10 @@ namespace drawinglayer::primitive2d
                                     getLocalObjectRange().getMinimum()));
 
                             // create FillBitmapPrimitive
-                            const 
drawinglayer::primitive2d::Primitive2DReference xFillBitmap(
+                            aRetval.set(
                                 new 
drawinglayer::primitive2d::FillGraphicPrimitive2D(
                                     aObjectTransform,
                                     aFillGraphicAttribute));
-                            aRetval = xFillBitmap;
 
                             // always embed tiled fill to clipping
                             bNeedsClipping = true;
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 960212ef6cdc..350205e5d298 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -127,9 +127,8 @@ void SvxDrawPage::dispose()
     // Create an event with this as sender
     try
     {
-        uno::Reference< uno::XInterface > xSource( uno::Reference< 
uno::XInterface >::query( static_cast<lang::XComponent *>(this) ) );
         css::document::EventObject aEvt;
-        aEvt.Source = xSource;
+        aEvt.Source.set(uno::Reference<uno::XInterface>::query( 
static_cast<lang::XComponent *>(this) ));
         // inform all listeners to release this object
         // The listener container are automatically cleared
         mrBHelper.aLC.disposeAndClear( aEvt );
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 739869e2ee8a..41faa061fdfc 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1525,8 +1525,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& 
rPropertyName)
                     {
                         // return nothing, because property <TextRange> isn't
                         // valid for to-page anchored shapes
-                        uno::Any aAny;
-                        aRet = aAny;
+                        aRet = uno::Any();
                     }
                     else
                     {
diff --git a/toolkit/source/controls/eventcontainer.cxx 
b/toolkit/source/controls/eventcontainer.cxx
index d47e6aa23bce..7611e0f2fe5f 100644
--- a/toolkit/source/controls/eventcontainer.cxx
+++ b/toolkit/source/controls/eventcontainer.cxx
@@ -133,12 +133,11 @@ void ScriptEventContainer::removeByName( const OUString& 
Name )
     }
 
     sal_Int32 iHashResult = (*aIt).second;
-    Any aOldElement = mValues[ iHashResult ];
 
     // Fire event
     ContainerEvent aEvent;
     aEvent.Source = *this;
-    aEvent.Element = aOldElement;
+    aEvent.Element = mValues[iHashResult];
     aEvent.Accessor <<= Name;
     maContainerListeners.elementRemoved( aEvent );
 

Reply via email to