chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx |    3 
+--
 chart2/source/tools/InternalData.cxx                                    |    4 
+---
 cui/source/dialogs/scriptdlg.cxx                                        |    3 
+--
 dbaccess/source/ui/querydesign/QueryTableView.cxx                       |    6 
+-----
 editeng/source/uno/unonrule.cxx                                         |    3 
+--
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx       |    3 
+--
 framework/source/uiconfiguration/uiconfigurationmanager.cxx             |    4 
++--
 i18npool/source/localedata/localedata.cxx                               |    3 
+--
 include/svx/svdograf.hxx                                                |    2 
+-
 include/vcl/uitest/logger.hxx                                           |    2 
+-
 scripting/source/stringresource/stringresource.cxx                      |    3 
+--
 starmath/inc/mathml/element.hxx                                         |    2 
+-
 sw/source/core/unocore/unocrsrhelper.cxx                                |    7 
+++----
 sw/source/uibase/shells/textsh2.cxx                                     |    3 
+--
 ucb/source/ucp/file/filtask.cxx                                         |    7 
++-----
 xmloff/source/text/XMLFootnoteImportContext.cxx                         |    3 
+--
 16 files changed, 20 insertions(+), 38 deletions(-)

New commits:
commit 90403600aaa997aaee3a9f1004786502f426ec5d
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Dec 3 21:00:01 2023 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Dec 4 10:49:13 2023 +0100

    cid#1545566 COPY_INSTEAD_OF_MOVE
    
    Change-Id: Ifd6c15630991c922f9392940142bb16c5e83685c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160286
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 80f4785d773e..930f952d0019 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2205,12 +2205,9 @@ TaskManager::load( const ContentMap::iterator& it, bool 
create )
     uno::Reference< ucb::XPersistentPropertySet > xS = 
m_xFileRegistry->openPropertySet( it->first,create );
     if( xS.is() )
     {
-        uno::Reference< beans::XPropertyContainer > xC( xS,uno::UNO_QUERY );
-        uno::Reference< beans::XPropertyAccess >    xA( xS,uno::UNO_QUERY );
-
         it->second.xS = xS;
-        it->second.xC = xC;
-        it->second.xA = xA;
+        it->second.xC.set(xS, uno::UNO_QUERY);
+        it->second.xA.set(xS, uno::UNO_QUERY);
 
         // Now put in all values in the storage in the local hash;
 
commit d51640061809034006db6d7ba1205c1f1f8b5fad
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Dec 3 20:02:30 2023 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Dec 4 10:48:59 2023 +0100

    cid#1546422 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1546416 COPY_INSTEAD_OF_MOVE
    cid#1546415 COPY_INSTEAD_OF_MOVE
    cid#1546391 COPY_INSTEAD_OF_MOVE
    cid#1546390 COPY_INSTEAD_OF_MOVE
    cid#1546317 COPY_INSTEAD_OF_MOVE
    cid#1546252 COPY_INSTEAD_OF_MOVE
    cid#1546251 COPY_INSTEAD_OF_MOVE
    cid#1546249 COPY_INSTEAD_OF_MOVE
    cid#1546243 COPY_INSTEAD_OF_MOVE
    cid#1546195 COPY_INSTEAD_OF_MOVE
    cid#1546193 COPY_INSTEAD_OF_MOVE
    cid#1546137 COPY_INSTEAD_OF_MOVE
    cid#1545738 COPY_INSTEAD_OF_MOVE
    cid#1545782 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I10d5091aa72b682371764b8a18cc5062e272c031
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160285
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git 
a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx 
b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index a50ac7527c76..e3ace3e9d4e2 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -160,8 +160,7 @@ void lcl_ConvertRangeToXML(
             lcl_getDataProviderFromContact( spChart2ModelContact ), 
uno::UNO_QUERY );
         if( xConverter.is())
         {
-            OUString aResult = xConverter->convertRangeToXML( rInOutRange );
-            rInOutRange = aResult;
+            rInOutRange = xConverter->convertRangeToXML( rInOutRange );
         }
     }
 }
diff --git a/chart2/source/tools/InternalData.cxx 
b/chart2/source/tools/InternalData.cxx
index 38eb848815db..d6321d317914 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -261,9 +261,7 @@ void InternalData::swapRowWithNext( sal_Int32 nRowIndex )
         std::swap(m_aData[nIndex1], m_aData[nIndex2]);
     }
 
-    std::vector< uno::Any > aTemp( m_aRowLabels[nRowIndex] );
-    m_aRowLabels[nRowIndex] = m_aRowLabels[nRowIndex + 1];
-    m_aRowLabels[nRowIndex + 1] = aTemp;
+    std::swap(m_aRowLabels[nRowIndex], m_aRowLabels[nRowIndex + 1]);
 }
 
 void InternalData::swapColumnWithNext( sal_Int32 nColumnIndex )
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 890034317c2a..3f1cb9fd33e4 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -1296,12 +1296,11 @@ OUString GetErrorMessage( const css::uno::Any& 
aException )
 void SvxScriptErrorDialog::ShowAsyncErrorDialog( weld::Window* pParent, 
css::uno::Any const & aException )
 {
     SolarMutexGuard aGuard;
-    OUString sMessage = GetErrorMessage( aException );
 
     // Pass a copy of the message to the ShowDialog method as the
     // SvxScriptErrorDialog may be deleted before ShowDialog is called
     DialogData* pData = new DialogData;
-    pData->sMessage = sMessage;
+    pData->sMessage = GetErrorMessage(aException);
     pData->pParent = pParent;
     Application::PostUserEvent(
         LINK( nullptr, SvxScriptErrorDialog, ShowDialog ),
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx 
b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index bd4d6c5a9080..663d3a9e65a6 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -561,11 +561,7 @@ void OQueryTableView::AddConnection(const 
OJoinExchangeData& jxdSource, const OJ
     {
         // the connection could point on the other side
         if(pConn->GetSourceWin() == pDestWin)
-        {
-            OUString aTmp(aSourceFieldName);
-            aSourceFieldName = aDestFieldName;
-            aDestFieldName = aTmp;
-        }
+            std::swap(aSourceFieldName, aDestFieldName);
 
         pConn->GetData()->AppendConnLine( aSourceFieldName,aDestFieldName );
 
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index 95c0a04daf0f..5083f4d8e846 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -207,8 +207,7 @@ Sequence<beans::PropertyValue> 
SvxUnoNumberingRules::getNumberingRuleByIndex(sal
         sal_UCS4 nCode = rFmt.GetBulletChar();
         OUString aStr( &nCode, 1 );
         aVal <<= aStr;
-        beans::PropertyValue aBulletProp( "BulletChar", -1, aVal, 
beans::PropertyState_DIRECT_VALUE);
-        pArray[nIdx++] = aBulletProp;
+        pArray[nIdx++] = beans::PropertyValue("BulletChar", -1, aVal, 
beans::PropertyState_DIRECT_VALUE);
     }
 
     if( rFmt.GetBulletFont() )
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 7427cd925956..65e12c8f8dd3 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -1243,14 +1243,13 @@ void SAL_CALL 
ModuleUIConfigurationManager::replaceSettings( const OUString& Res
                 rElements.emplace( ResourceURL, aUIElementData );
 
             Reference< XUIConfigurationManager > xThis(this);
-            Reference< XInterface > xIfac( xThis, UNO_QUERY );
 
             // Create event to notify listener about replaced element settings
             ui::ConfigurationEvent aEvent;
 
             aEvent.ResourceURL = ResourceURL;
             aEvent.Accessor <<= xThis;
-            aEvent.Source = xIfac;
+            aEvent.Source.set(xThis, UNO_QUERY);
             aEvent.ReplacedElement <<= pDataSettings->xSettings;
             aEvent.Element <<= aUIElementData.xSettings;
 
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 0140d17866d1..b678f7b0635c 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -1027,14 +1027,14 @@ void SAL_CALL UIConfigurationManager::removeSettings( 
const OUString& ResourceUR
             rElementType.bModified = true;
 
             Reference< XUIConfigurationManager > xThis(this);
-            Reference< XInterface > xIfac( xThis, UNO_QUERY );
 
             // Create event to notify listener about removed element settings
             ConfigurationEvent aEvent;
 
             aEvent.ResourceURL = ResourceURL;
             aEvent.Accessor <<= xThis;
-            aEvent.Source = xIfac;
+            aEvent.Source.set(xThis, UNO_QUERY);
+
             aEvent.Element <<= xRemovedSettings;
 
             aGuard.clear();
diff --git a/i18npool/source/localedata/localedata.cxx 
b/i18npool/source/localedata/localedata.cxx
index 6408740885f3..01bd4ad59e33 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -758,9 +758,8 @@ LocaleDataImpl::getAllCalendars2( const Locale& rLocale )
             offset++;
             sal_Int16 minimalDaysInFirstWeek = allCalendars[offset][0];
             offset++;
-            Calendar2 aCalendar(days, months, gmonths, pmonths, eras, 
startOfWeekDay,
+            calendarsSeqRange[i] = Calendar2(days, months, gmonths, pmonths, 
eras, startOfWeekDay,
                     minimalDaysInFirstWeek, defaultCalendar, calendarID);
-            calendarsSeqRange[i] = aCalendar;
         }
         return calendarsSeq;
     }
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index cb88b4c2a770..c920ac1de4ff 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -277,7 +277,7 @@ public:
         return mpSignatureLineUnsignedGraphic;
     }
 
-    void 
setSignatureLineUnsignedGraphic(css::uno::Reference<css::graphic::XGraphic> 
rGraphic)
+    void setSignatureLineUnsignedGraphic(const 
css::uno::Reference<css::graphic::XGraphic>& rGraphic)
     {
         mpSignatureLineUnsignedGraphic = rGraphic;
     }
diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx
index c810b7eb7de7..bc353ad4ea11 100644
--- a/include/vcl/uitest/logger.hxx
+++ b/include/vcl/uitest/logger.hxx
@@ -58,7 +58,7 @@ public:
 
     static UITestLogger& getInstance();
 
-    void setAppName(OUString name) { app_name = name; }
+    void setAppName(const OUString& name) { app_name = name; }
 
     const OUString& getAppName() const { return app_name; }
 };
diff --git a/scripting/source/stringresource/stringresource.cxx 
b/scripting/source/stringresource/stringresource.cxx
index 096692602407..79090c6eeaad 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -195,8 +195,7 @@ Sequence< OUString > 
StringResourceImpl::implGetResourceIDs( LocaleItem* pLocale
         int iTarget = 0;
         for( const auto& rEntry : rHashMap )
         {
-            OUString aStr = rEntry.first;
-            pStrings[iTarget] = aStr;
+            pStrings[iTarget] = rEntry.first;
             iTarget++;
         }
     }
diff --git a/starmath/inc/mathml/element.hxx b/starmath/inc/mathml/element.hxx
index 97d7299e5df2..3b39edbf126e 100644
--- a/starmath/inc/mathml/element.hxx
+++ b/starmath/inc/mathml/element.hxx
@@ -284,7 +284,7 @@ public: // text elements
     /**
       * Returns the element text
       */
-    void setText(OUString aText) { m_aText = aText; };
+    void setText(const OUString& rText) { m_aText = rText; };
 };
 
 namespace starmathdatabase
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index 70e94360f65c..70a724814cc6 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -887,11 +887,10 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam)
                         const SvxFontListItem* pFontListItem =
                                 static_cast<const SvxFontListItem* 
>(rDoc.GetDocShell()
                                                     ->GetItem( 
SID_ATTR_CHAR_FONTLIST ));
-                        const FontList*  pList = pFontListItem->GetFontList();
+                        const FontList* pList = pFontListItem->GetFontList();
 
-                        FontMetric aFontMetric = pList->Get(
-                            pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE);
-                        vcl::Font aFont(aFontMetric);
+                        vcl::Font aFont(pList->Get(
+                            pBulletFontNames[i],WEIGHT_NORMAL, ITALIC_NONE));
                         aFormat.SetBulletFont(&aFont);
                     }
                     aRule.Set( i, aFormat );
diff --git a/sw/source/uibase/shells/textsh2.cxx 
b/sw/source/uibase/shells/textsh2.cxx
index 8f05aef76788..8a62f401fe46 100644
--- a/sw/source/uibase/shells/textsh2.cxx
+++ b/sw/source/uibase/shells/textsh2.cxx
@@ -239,8 +239,7 @@ IMPL_LINK( SwBaseShell, InsertDBTextHdl, void*, p, void )
                                                                                
                 aDBData));
             if( RET_OK == pDlg->Execute() )
             {
-                Reference <XResultSet> xResSet = pDBStruct->xCursor;
-                pDlg->DataToDoc( pDBStruct->aSelection, xSource, xConnection, 
xResSet);
+                pDlg->DataToDoc(pDBStruct->aSelection, xSource, xConnection, 
pDBStruct->xCursor);
             }
         }
         if ( bDispose )
diff --git a/xmloff/source/text/XMLFootnoteImportContext.cxx 
b/xmloff/source/text/XMLFootnoteImportContext.cxx
index f2a074033d6e..cf206e5d6e39 100644
--- a/xmloff/source/text/XMLFootnoteImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteImportContext.cxx
@@ -112,8 +112,7 @@ void XMLFootnoteImportContext::startFastElement(
     mbListContextPushed = true;
 
     // remember footnote (for CreateChildContext)
-    Reference<XFootnote> xNote(xTextContent, UNO_QUERY);
-    xFootnote = xNote;
+    xFootnote.set(xTextContent, UNO_QUERY);
 
     // else: ignore footnote! Content will be merged into document.
 }

Reply via email to