chart2/source/tools/InternalData.cxx                        |    4 +---
 desktop/inc/lib/init.hxx                                    |    4 ++--
 framework/source/uiconfiguration/uiconfigurationmanager.cxx |    3 +--
 include/svtools/acceleratorexecute.hxx                      |    2 +-
 oox/source/crypto/AgileEngine.cxx                           |    9 +++------
 sc/source/filter/orcus/interface.cxx                        |    9 +++------
 sd/source/core/CustomAnimationPreset.cxx                    |    3 +--
 starmath/source/parse5.cxx                                  |    6 ++----
 svtools/source/misc/acceleratorexecute.cxx                  |    2 +-
 unotools/source/config/lingucfg.cxx                         |    5 +----
 vcl/inc/jsdialog/jsdialogbuilder.hxx                        |    2 +-
 xmloff/source/draw/XMLImageMapContext.cxx                   |    8 ++------
 xmloff/source/style/xmlnumi.cxx                             |    3 +--
 13 files changed, 20 insertions(+), 40 deletions(-)

New commits:
commit d03dc3dfcede8f9b00cc9be4b0b1f25749a53c61
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Dec 9 21:45:20 2023 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Dec 10 11:57:42 2023 +0100

    cid#1545912 std::swap COPY_INSTEAD_OF_MOVE
    
    Change-Id: Ib3468b43015821225d0236fca5550392f69e1154
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160523
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/chart2/source/tools/InternalData.cxx 
b/chart2/source/tools/InternalData.cxx
index d6321d317914..e6e926078eb3 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -277,9 +277,7 @@ void InternalData::swapColumnWithNext( sal_Int32 
nColumnIndex )
         std::swap(m_aData[nIndex1], m_aData[nIndex2]);
     }
 
-    std::vector< uno::Any > aTemp( m_aColumnLabels[nColumnIndex] );
-    m_aColumnLabels[nColumnIndex] = m_aColumnLabels[nColumnIndex + 1];
-    m_aColumnLabels[nColumnIndex + 1] = aTemp;
+    std::swap(m_aColumnLabels[nColumnIndex], m_aColumnLabels[nColumnIndex + 
1]);
 }
 
 bool InternalData::enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount )
commit 15ff0c3828406aa00d8fa0d1e7de90916f9c13cc
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Dec 9 21:30:30 2023 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Dec 10 11:57:35 2023 +0100

    cid#1545975 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1545955 COPY_INSTEAD_OF_MOVE
    cid#1545954 COPY_INSTEAD_OF_MOVE
    cid#1545952 COPY_INSTEAD_OF_MOVE
    cid#1545948 COPY_INSTEAD_OF_MOVE
    cid#1545943 COPY_INSTEAD_OF_MOVE
    cid#1545935 COPY_INSTEAD_OF_MOVE
    cid#1545930 COPY_INSTEAD_OF_MOVE
    cid#1545928 COPY_INSTEAD_OF_MOVE
    cid#1545925 COPY_INSTEAD_OF_MOVE
    cid#1545922 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I28d830504337f417829c675b1eb9c763b83b30c4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160522
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 323a508098f5..8f046c3ae81f 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -129,12 +129,12 @@ namespace desktop {
         struct CallbackData
         {
             CallbackData(OString payload)
-                : PayloadString(payload)
+                : PayloadString(std::move(payload))
             {
             }
 
             CallbackData(OString payload, int viewId)
-                : PayloadString(payload)
+                : PayloadString(std::move(payload))
                 , PayloadObject(viewId)
             {
             }
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 54034b67e8ed..e4f396221d95 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -1099,14 +1099,13 @@ void SAL_CALL UIConfigurationManager::insertSettings( 
const OUString& NewResourc
 
             Reference< XIndexAccess > xInsertSettings( 
aUIElementData.xSettings );
             Reference< XUIConfigurationManager > xThis(this);
-            Reference< XInterface > xIfac( xThis, UNO_QUERY );
 
             // Create event to notify listener about removed element settings
             ConfigurationEvent aEvent;
 
             aEvent.ResourceURL = NewResourceURL;
             aEvent.Accessor <<= xThis;
-            aEvent.Source = xIfac;
+            aEvent.Source.set(xThis, UNO_QUERY);
             aEvent.Element <<= xInsertSettings;
 
             aGuard.clear();
diff --git a/include/svtools/acceleratorexecute.hxx 
b/include/svtools/acceleratorexecute.hxx
index 141c9ec8597f..3601e6043537 100644
--- a/include/svtools/acceleratorexecute.hxx
+++ b/include/svtools/acceleratorexecute.hxx
@@ -177,7 +177,7 @@ class SVT_DLLPUBLIC AcceleratorExecute final
                                                                                
               const css::uno::Reference< css::frame::XFrame >&              
xFrame);
 
         static css::uno::Reference<css::ui::XAcceleratorConfiguration> 
lok_createNewAcceleratorConfiguration(const css::uno::Reference< 
css::uno::XComponentContext >& rxContext, OUString sModule);
-        void 
lok_setModuleConfig(css::uno::Reference<css::ui::XAcceleratorConfiguration> 
acceleratorConfig);
+        void lok_setModuleConfig(const 
css::uno::Reference<css::ui::XAcceleratorConfiguration>& acceleratorConfig);
 
         /** TODO document me */
         static css::uno::Reference< css::ui::XAcceleratorConfiguration > 
st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel);
diff --git a/oox/source/crypto/AgileEngine.cxx 
b/oox/source/crypto/AgileEngine.cxx
index 36fda7002b7d..857034777357 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -202,20 +202,17 @@ bool hashCalc(std::vector<sal_uInt8>& output,
 {
     if (sAlgorithm == u"SHA1")
     {
-        std::vector<unsigned char> out = 
comphelper::Hash::calculateHash(input.data(), input.size(), 
comphelper::HashType::SHA1);
-        output = out;
+        output = comphelper::Hash::calculateHash(input.data(), input.size(), 
comphelper::HashType::SHA1);
         return true;
     }
     else if (sAlgorithm == u"SHA384")
     {
-        std::vector<unsigned char> out = 
comphelper::Hash::calculateHash(input.data(), input.size(), 
comphelper::HashType::SHA384);
-        output = out;
+        output = comphelper::Hash::calculateHash(input.data(), input.size(), 
comphelper::HashType::SHA384);
         return true;
     }
     else if (sAlgorithm == u"SHA512")
     {
-        std::vector<unsigned char> out = 
comphelper::Hash::calculateHash(input.data(), input.size(), 
comphelper::HashType::SHA512);
-        output = out;
+        output = comphelper::Hash::calculateHash(input.data(), input.size(), 
comphelper::HashType::SHA512);
         return true;
     }
     return false;
diff --git a/sc/source/filter/orcus/interface.cxx 
b/sc/source/filter/orcus/interface.cxx
index b349016355b7..f9e78e27f4b1 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -2090,14 +2090,12 @@ void ScOrucsImportCellStyle::reset()
 
 void ScOrucsImportCellStyle::set_name(std::string_view name)
 {
-    OUString aName(name.data(), name.size(), 
mrFactory.getGlobalSettings().getTextEncoding());
-    maCurrentStyle.maName = aName;
+    maCurrentStyle.maName = OUString(name.data(), name.size(), 
mrFactory.getGlobalSettings().getTextEncoding());
 }
 
 void ScOrucsImportCellStyle::set_display_name(std::string_view name)
 {
-    OUString aName(name.data(), name.size(), 
mrFactory.getGlobalSettings().getTextEncoding());
-    maCurrentStyle.maDisplayName = aName;
+    maCurrentStyle.maDisplayName = OUString(name.data(), name.size(), 
mrFactory.getGlobalSettings().getTextEncoding());
 }
 
 void ScOrucsImportCellStyle::set_xf(size_t index)
@@ -2112,8 +2110,7 @@ void ScOrucsImportCellStyle::set_builtin(size_t index)
 
 void ScOrucsImportCellStyle::set_parent_name(std::string_view name)
 {
-    const OUString aParentName(name.data(), name.size(), 
mrFactory.getGlobalSettings().getTextEncoding());
-    maCurrentStyle.maParentName = aParentName;
+    maCurrentStyle.maParentName = OUString(name.data(), name.size(), 
mrFactory.getGlobalSettings().getTextEncoding());
 }
 
 void ScOrucsImportCellStyle::commit()
diff --git a/sd/source/core/CustomAnimationPreset.cxx 
b/sd/source/core/CustomAnimationPreset.cxx
index 242af4bd3a00..ad7b8645fe10 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -217,12 +217,11 @@ Reference< XAnimationNode > implImportEffects( const 
Reference< XMultiServiceFac
     {
         // create stream
         std::unique_ptr<SvStream> pIStm = 
::utl::UcbStreamHelper::CreateStream( rPath, StreamMode::READ );
-        Reference<XInputStream> xInputStream( new utl::OInputStreamWrapper( 
std::move(pIStm) ) );
 
         // prepare ParserInputSource
         xml::sax::InputSource aParserInput;
         aParserInput.sSystemId = rPath;
-        aParserInput.aInputStream = xInputStream;
+        aParserInput.aInputStream.set(new 
utl::OInputStreamWrapper(std::move(pIStm)));
 
         // get filter
         Reference< xml::sax::XFastParser > xFilter( 
xServiceFactory->createInstance("com.sun.star.comp.Xmloff.AnimationsImport" ), 
UNO_QUERY_THROW );
diff --git a/starmath/source/parse5.cxx b/starmath/source/parse5.cxx
index 8f2815c3c3b4..eea7e7f05edf 100644
--- a/starmath/source/parse5.cxx
+++ b/starmath/source/parse5.cxx
@@ -2715,12 +2715,10 @@ std::unique_ptr<SmExpressionNode> 
SmParser5::DoError(SmParseError eError)
 {
     DepthProtect aDepthGuard(m_nParseDepth);
 
-    // Identify error message
-    OUString sStrBuf(SmResId(RID_ERR_IDENT) + 
starmathdatabase::getParseErrorDesc(eError));
-
     // Generate error node
     m_aCurToken.eType = TERROR;
-    m_aCurToken.cMathChar = sStrBuf;
+    // Identify error message
+    m_aCurToken.cMathChar = SmResId(RID_ERR_IDENT) + 
starmathdatabase::getParseErrorDesc(eError);
     auto xSNode = std::make_unique<SmExpressionNode>(m_aCurToken);
     SmErrorNode* pErr(new SmErrorNode(m_aCurToken));
     pErr->SetSelection(m_aCurESelection);
diff --git a/svtools/source/misc/acceleratorexecute.cxx 
b/svtools/source/misc/acceleratorexecute.cxx
index 70e1bc6c6b8a..dfc7335831b0 100644
--- a/svtools/source/misc/acceleratorexecute.cxx
+++ b/svtools/source/misc/acceleratorexecute.cxx
@@ -429,7 +429,7 @@ css::uno::Reference<css::ui::XAcceleratorConfiguration> 
AcceleratorExecute::lok_
     return css::uno::Reference<css::ui::XAcceleratorConfiguration>();
 }
 
-void 
AcceleratorExecute::lok_setModuleConfig(css::uno::Reference<css::ui::XAcceleratorConfiguration>
 acceleratorConfig)
+void AcceleratorExecute::lok_setModuleConfig(const 
css::uno::Reference<css::ui::XAcceleratorConfiguration>& acceleratorConfig)
 {
     this->m_xModuleCfg = acceleratorConfig;
 }
diff --git a/unotools/source/config/lingucfg.cxx 
b/unotools/source/config/lingucfg.cxx
index 730cab027f4b..4ebd72a91c15 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -1177,10 +1177,7 @@ OUString SvtLinguConfig::GetSynonymsContextImage(
 {
     OUString   aRes;
     if (!rServiceImplName.isEmpty())
-    {
-        OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, 
"SynonymsContextMenuImage" ) );
-        aRes = aPath;
-    }
+        aRes = GetVendorImageUrl_Impl(rServiceImplName, 
"SynonymsContextMenuImage");
     return aRes;
 }
 
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 6e611c4f962c..4e764edf8c56 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -381,7 +381,7 @@ public:
     JSWidget(JSDialogSender* pSender, VclClass* pObject, SalInstanceBuilder* 
pBuilder,
              const a11yref& rAlly, FactoryFunction pUITestFactoryFunction, 
void* pUserData,
              bool bTakeOwnership)
-        : BaseInstanceClass(pObject, pBuilder, rAlly, pUITestFactoryFunction, 
pUserData,
+        : BaseInstanceClass(pObject, pBuilder, rAlly, 
std::move(pUITestFactoryFunction), pUserData,
                             bTakeOwnership)
         , m_bIsFreezed(false)
         , m_pSender(pSender)
diff --git a/xmloff/source/draw/XMLImageMapContext.cxx 
b/xmloff/source/draw/XMLImageMapContext.cxx
index e3a16c08636c..069d5025dea0 100644
--- a/xmloff/source/draw/XMLImageMapContext.cxx
+++ b/xmloff/source/draw/XMLImageMapContext.cxx
@@ -120,12 +120,8 @@ XMLImageMapObjectContext::XMLImageMapObjectContext(
     Reference<XInterface> xIfc = xFactory->createInstance(
         OUString::createFromAscii(pServiceName));
     DBG_ASSERT(xIfc.is(), "can't create image map object!");
-    if( xIfc.is() )
-    {
-        Reference<XPropertySet> xPropertySet( xIfc, UNO_QUERY );
-
-        xMapEntry = xPropertySet;
-    }
+    if (xIfc.is())
+        xMapEntry.set(xIfc, UNO_QUERY);
     // else: can't create service -> ignore
     // else: can't even get factory -> ignore
 }
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 0ddab1466df8..c6233e09d280 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -969,8 +969,7 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool 
bOverwrite )
             Reference < XInterface > xIfc = 
xFactory->createInstance("com.sun.star.style.NumberingStyle");
             if( !xIfc.is() )
                 return;
-            Reference < XStyle > xTmp( xIfc, UNO_QUERY );
-            xStyle = xTmp;
+            xStyle.set(xIfc, UNO_QUERY);
             if( !xStyle.is() )
                 return;
 

Reply via email to