cid#1546500 COPY_INSTEAD_OF_MOVE

and

cid#1546492 COPY_INSTEAD_OF_MOVE
cid#1546468 COPY_INSTEAD_OF_MOVE
cid#1546431 COPY_INSTEAD_OF_MOVE
cid#1546382 COPY_INSTEAD_OF_MOVE
cid#1546350 COPY_INSTEAD_OF_MOVE
cid#1546336 COPY_INSTEAD_OF_MOVE
cid#1546314 COPY_INSTEAD_OF_MOVE
cid#1546152 COPY_INSTEAD_OF_MOVE
cid#1546094 COPY_INSTEAD_OF_MOVE
cid#1546077 COPY_INSTEAD_OF_MOVE
cid#1546047 COPY_INSTEAD_OF_MOVE
cid#1545213 COPY_INSTEAD_OF_MOVE

Change-Id: Ia51df9f9cbde755db4d2685e34f22676ed5eceff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161141
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index 899dfe2..214031e 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -84,8 +84,7 @@ ScaleData AxisHelper::createDefaultScale()

void AxisHelper::removeExplicitScaling( ScaleData& rScaleData )
{
    uno::Any aEmpty;
    rScaleData.Minimum = rScaleData.Maximum = rScaleData.Origin = aEmpty;
    rScaleData.Minimum = rScaleData.Maximum = rScaleData.Origin = uno::Any();
    rScaleData.Scaling = nullptr;
    ScaleData aDefaultScale( createDefaultScale() );
    rScaleData.IncrementData = aDefaultScale.IncrementData;
diff --git a/include/vcl/test/GraphicsRenderTests.hxx b/include/vcl/test/GraphicsRenderTests.hxx
index f931d94..225a25c 100644
--- a/include/vcl/test/GraphicsRenderTests.hxx
+++ b/include/vcl/test/GraphicsRenderTests.hxx
@@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
 * This file is part of the LibreOffice project.
 *
@@ -154,7 +154,8 @@ class VCL_PLUGIN_PUBLIC GraphicsRenderTests
    void testDrawOpenBezierWithPolyLineB2D();
    static OUString returnTestStatus(vcl::test::TestResult const result);
    void runALLTests();
    void appendTestResult(OUString aTestName, OUString aTestStatus, Bitmap aTestBitmap = Bitmap());
    void appendTestResult(const OUString& rTestName, const OUString& rTestStatus,
                          const Bitmap& rTestBitmap = Bitmap());

public:
    std::vector<VclTestResult>& getTestResults();
@@ -166,3 +167,5 @@ public:
    {
    }
};

/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index c332c95..46baa40 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -615,10 +615,10 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OUString &rNam
    if (!rName.isEmpty())
        pDlg->SetCurPageId(rName);

    auto pRequest = std::make_shared<SfxRequest>(rReq);
    auto xRequest = std::make_shared<SfxRequest>(rReq);
    rReq.Ignore(); // the 'old' request is not relevant any more

    pDlg->StartExecuteAsync([pDlg, pOldSet, pRequest, this](sal_Int32 nResult){
    pDlg->StartExecuteAsync([pDlg, pOldSet, xRequest=std::move(xRequest), this](sal_Int32 nResult){
        bInFormatDialog = false;

        if ( nResult == RET_OK )
@@ -631,7 +631,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OUString &rNam

            ApplyAttributes(*pOutSet, *pOldSet);

            pRequest->Done(*pOutSet);
            xRequest->Done(*pOutSet);
        }

        pDlg->disposeOnce();
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 2ac3b93..42d6295 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -163,8 +163,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                        }
                    }

                    std::shared_ptr<SfxRequest> pReq = std::make_shared<SfxRequest>(rReq);
                    pDlg->StartExecuteAsync([this, pDlg, pReq](sal_Int32 nResult){
                    std::shared_ptr<SfxRequest> xReq = std::make_shared<SfxRequest>(rReq);
                    pDlg->StartExecuteAsync([this, pDlg, xReq = std::move(xReq)](sal_Int32 nResult){
                        std::vector<OUString> sTables;
                        if (RET_OK == nResult)
                        {
@@ -172,11 +172,11 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                            for (auto a : aSelectedRows)
                            {
                                OUString sTable = pDlg->GetEntry(a);
                                pReq->AppendItem( SfxStringItem( FID_TABLE_SHOW, sTable ) );
                                xReq->AppendItem( SfxStringItem( FID_TABLE_SHOW, sTable ) );
                                sTables.push_back(sTable);
                            }
                            ShowTable( sTables );
                            pReq->Done();
                            xReq->Done();
                        }
                        pDlg->disposeOnce();
                    });
diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx
index cd6c20d..690a07f 100644
--- a/sd/source/console/PresenterScreen.cxx
+++ b/sd/source/console/PresenterScreen.cxx
@@ -561,10 +561,10 @@ void PresenterScreen::RequestShutdownPresenterScreen()
        // asynchronously.  The view and pane factories can only by disposed
        // after that.  Therefore, set up a listener and wait for the
        // restoration.
        rtl::Reference<PresenterScreen> pSelf (this);
        rtl::Reference<PresenterScreen> xSelf(this);
        PresenterFrameworkObserver::RunOnUpdateEnd(
            xCC,
            [pSelf](bool){ return pSelf->ShutdownPresenterScreen(); });
            [xSelf=std::move(xSelf)](bool){ return xSelf->ShutdownPresenterScreen(); });
        xCC->update();
    }
}
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index 8c565a3..aef7157 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -110,15 +110,15 @@ void FuTransform::DoExecute( SfxRequest& rReq )

    assert(pDlg && "there must be a dialog at this point");

    auto pRequest = std::make_shared<SfxRequest>(rReq);
    auto xRequest = std::make_shared<SfxRequest>(rReq);
    rReq.Ignore(); // the 'old' request is not relevant any more

    pDlg->StartExecuteAsync([bWelded, pDlg, pRequest, this](sal_Int32 nResult){
    pDlg->StartExecuteAsync([bWelded, pDlg, xRequest=std::move(xRequest), this](sal_Int32 nResult){
        if (nResult == RET_OK)
        {
            pRequest->Done(*(pDlg->GetOutputItemSet()));
            xRequest->Done(*(pDlg->GetOutputItemSet()));
            // Page margin is already calculated at this point.
            setUndo(mpView, pRequest->GetArgs(), false);
            setUndo(mpView, xRequest->GetArgs(), false);
        }

        // deferred until the dialog ends
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index fedbfb2..8340e48 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -712,10 +712,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)

                if (!rReq.IsSynchronCall())
                {
                    std::shared_ptr<SfxRequest> pReq = std::make_shared<SfxRequest>(rReq);
                    SfxTabDialogController::runAsync(xDlg, [pReq, aFunc](sal_Int32 nResult)
                    std::shared_ptr<SfxRequest> xReq = std::make_shared<SfxRequest>(rReq);
                    SfxTabDialogController::runAsync(xDlg, [xReq=std::move(xReq), aFunc](sal_Int32 nResult)
                    {
                        aFunc(nResult, *pReq);
                        aFunc(nResult, *xReq);
                    });
                    rReq.Ignore();
                }
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index df70cb1..3c3a614 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
@@ -198,9 +198,9 @@ void AnimationCommandNode::activate_st()
    }

    // deactivate ASAP:
    auto self(getSelf());
    std::shared_ptr<BaseNode> self(getSelf());
    scheduleDeactivationEvent(
        makeEvent( [self] () { self->deactivate(); },
        makeEvent( [self=std::move(self)] () { self->deactivate(); },
                   "AnimationCommandNode::deactivate" ) );
}

diff --git a/svl/source/passwordcontainer/passwordcontainer.hxx b/svl/source/passwordcontainer/passwordcontainer.hxx
index 80fae57..81190f6 100644
--- a/svl/source/passwordcontainer/passwordcontainer.hxx
+++ b/svl/source/passwordcontainer/passwordcontainer.hxx
@@ -58,12 +58,12 @@ class NamePasswordRecord
    OUString                    m_aPersistentPassword;
    OUString                    m_aPersistentIV;

    void InitArrays( bool bHasMemoryList, ::std::vector< OUString >&& aMemoryList,
    void InitArrays( bool bHasMemoryList, const std::vector<OUString>& rMemoryList,
                     bool bHasPersistentList, const OUString& aPersistentList, const OUString& aPersistentIV )
    {
        m_bHasMemoryPasswords = bHasMemoryList;
        if ( bHasMemoryList )
            m_aMemoryPasswords = aMemoryList;
            m_aMemoryPasswords = rMemoryList;

        m_bHasPersistentPassword = bHasPersistentList;
        if ( bHasPersistentList )
@@ -96,7 +96,7 @@ public:
        , m_bHasMemoryPasswords( false )
        , m_bHasPersistentPassword( false )
    {
        InitArrays( aRecord.m_bHasMemoryPasswords, std::vector(aRecord.m_aMemoryPasswords),
        InitArrays( aRecord.m_bHasMemoryPasswords, aRecord.m_aMemoryPasswords,
                    aRecord.m_bHasPersistentPassword, aRecord.m_aPersistentPassword, aRecord.m_aPersistentIV );
    }

@@ -109,7 +109,7 @@ public:
            m_aMemoryPasswords.clear();
            m_aPersistentPassword.clear();
            m_aPersistentIV.clear();
            InitArrays( aRecord.m_bHasMemoryPasswords, std::vector(aRecord.m_aMemoryPasswords),
            InitArrays( aRecord.m_bHasMemoryPasswords, aRecord.m_aMemoryPasswords,
                        aRecord.m_bHasPersistentPassword, aRecord.m_aPersistentPassword, aRecord.m_aPersistentIV );
        }
        return *this;
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index f019317..bbb88a1 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1942,9 +1942,9 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext(
            {
                ::accessibility::ShapeTypeHandler& rShapeTypeHandler =
                            ::accessibility::ShapeTypeHandler::Instance();
                uno::Reference < XAccessible > xParent( pParentImpl );

                ::accessibility::AccessibleShapeInfo aShapeInfo(
                        xShape, xParent, this );
                        xShape, uno::Reference<XAccessible>(pParentImpl), this );

                pAcc = rShapeTypeHandler.CreateAccessibleObject(
                            aShapeInfo, mpShapeMap->GetInfo() );
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 18ee57b..b1e3073 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -4876,8 +4876,9 @@ void INetURLObject::SetExtension(std::u16string_view rTheExtension)
OUString INetURLObject::CutExtension()
{
    OUString aTheExtension(getExtension(LAST_SEGMENT, false));
    return removeExtension(LAST_SEGMENT, false)
        ? aTheExtension : OUString();
    if (removeExtension(LAST_SEGMENT, false))
        return aTheExtension;
    return OUString();
}

bool INetURLObject::IsExoticProtocol() const
diff --git a/vcl/backendtest/GraphicsRenderTests.cxx b/vcl/backendtest/GraphicsRenderTests.cxx
index 962c60f..575a863 100644
--- a/vcl/backendtest/GraphicsRenderTests.cxx
+++ b/vcl/backendtest/GraphicsRenderTests.cxx
@@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
 * This file is part of the LibreOffice project.
 *
@@ -2482,10 +2482,10 @@ void GraphicsRenderTests::runALLTests()
    testDrawOpenBezierWithPolyLineB2D();
}

void GraphicsRenderTests::appendTestResult(OUString aTestName, OUString aTestStatus,
                                           Bitmap aTestBitmap)
void GraphicsRenderTests::appendTestResult(const OUString& rTestName, const OUString& rTestStatus,
                                           const Bitmap& rTestBitmap)
{
    m_aTestResult.push_back(VclTestResult(aTestName, aTestStatus, aTestBitmap));
    m_aTestResult.push_back(VclTestResult(rTestName, rTestStatus, rTestBitmap));
}

std::vector<VclTestResult>& GraphicsRenderTests::getTestResults() { return m_aTestResult; }
@@ -2593,3 +2593,5 @@ void GraphicsRenderTests::run(bool storeResultBitmap)
    }
    logFile.WriteOString(OUStringToOString(writeResult, RTL_TEXTENCODING_UTF8));
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/writerfilter/inc/dmapper/resourcemodel.hxx b/writerfilter/inc/dmapper/resourcemodel.hxx
index 695c6c9..b983dec 100644
--- a/writerfilter/inc/dmapper/resourcemodel.hxx
+++ b/writerfilter/inc/dmapper/resourcemodel.hxx
@@ -282,7 +282,7 @@ public:

       @param ref    reference to the properties
     */
    virtual void props(writerfilter::Reference<Properties>::Pointer_t ref) = 0;
    virtual void props(const writerfilter::Reference<Properties>::Pointer_t& ref) = 0;

    /**
       Receives table.
@@ -290,7 +290,7 @@ public:
       @param name     name of the table
       @param ref      reference to the table
     */
    virtual void table(Id name, writerfilter::Reference<Table>::Pointer_t ref) = 0;
    virtual void table(Id name, const writerfilter::Reference<Table>::Pointer_t& ref) = 0;

    /**
        Receives a substream.
@@ -298,7 +298,7 @@ public:
        @param name    name of the substream
        @param ref     reference to the substream
    */
    virtual void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) = 0;
    virtual void substream(Id name, const writerfilter::Reference<Stream>::Pointer_t& ref) = 0;

    /**
       Debugging: Receives information about current point in stream.
diff --git a/writerfilter/source/dmapper/LoggedResources.cxx b/writerfilter/source/dmapper/LoggedResources.cxx
index 739b2f4..05ebcd0 100644
--- a/writerfilter/source/dmapper/LoggedResources.cxx
+++ b/writerfilter/source/dmapper/LoggedResources.cxx
@@ -235,7 +235,7 @@ void LoggedStream::positivePercentage(const OUString& rText)
#endif
}

void LoggedStream::props(writerfilter::Reference<Properties>::Pointer_t ref)
void LoggedStream::props(const writerfilter::Reference<Properties>::Pointer_t& ref)
{
#ifdef DBG_UTIL
    mHelper.startElement("props");
@@ -248,7 +248,7 @@ void LoggedStream::props(writerfilter::Reference<Properties>::Pointer_t ref)
#endif
}

void LoggedStream::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
void LoggedStream::table(Id name, const writerfilter::Reference<Table>::Pointer_t& ref)
{
#ifdef DBG_UTIL
    mHelper.startElement("table");
@@ -262,7 +262,7 @@ void LoggedStream::table(Id name, writerfilter::Reference<Table>::Pointer_t ref)
#endif
}

void LoggedStream::substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref)
void LoggedStream::substream(Id name, const writerfilter::Reference<Stream>::Pointer_t& ref)
{
#ifdef DBG_UTIL
    mHelper.startElement("substream");
diff --git a/writerfilter/source/dmapper/LoggedResources.hxx b/writerfilter/source/dmapper/LoggedResources.hxx
index b729f86..0b41a22 100644
--- a/writerfilter/source/dmapper/LoggedResources.hxx
+++ b/writerfilter/source/dmapper/LoggedResources.hxx
@@ -67,9 +67,9 @@ public:
    void positionOffset(const OUString& rText, bool bVertical) override;
    void align(const OUString& rText, bool bVertical) override;
    void positivePercentage(const OUString& rText) override;
    void props(writerfilter::Reference<Properties>::Pointer_t ref) override;
    void table(Id name, writerfilter::Reference<Table>::Pointer_t ref) override;
    void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) override;
    void props(const writerfilter::Reference<Properties>::Pointer_t& ref) override;
    void table(Id name, const writerfilter::Reference<Table>::Pointer_t& ref) override;
    void substream(Id name, const writerfilter::Reference<Stream>::Pointer_t& ref) override;
    void info(const std::string& info) override;
    void startGlossaryEntry() override;
    void endGlossaryEntry() override;
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index 56b9fd4..aafb580 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -1250,10 +1250,9 @@ void XMLEnhancedCustomShapeContext::endFastElement(sal_Int32 )
                        EquationHashMap::iterator aHashIter( aH.find( aEquationName ) );
                        if ( aHashIter != aH.end() )
                            nIndex = (*aHashIter).second;
                        OUString aNew = rEquation.subView( 0, nIndexOf + 1 ) +
                        rEquation = rEquation.subView( 0, nIndexOf + 1 ) +
                            OUString::number( nIndex ) +
                            rEquation.subView( nIndexOf + aEquationName.getLength() + 1 );
                        rEquation = aNew;
                    }
                    nIndexOf++;
                }