chart2/source/model/main/ChartModel.cxx                  |   21 ++++++++-------
 chart2/source/model/main/Diagram.cxx                     |    4 +-
 chart2/source/view/charttypes/CandleStickChart.cxx       |    4 --
 connectivity/source/manager/mdrivermanager.cxx           |    4 +-
 framework/source/services/frame.cxx                      |   18 +++++++-----
 include/oox/helper/refvector.hxx                         |    6 ++--
 oox/source/ole/vbaproject.cxx                            |    4 +-
 sc/source/core/data/column.cxx                           |    8 +++--
 sc/source/core/data/table3.cxx                           |   12 +++++---
 ucb/source/core/ucbstore.cxx                             |    2 -
 vcl/inc/jsdialog/jsdialogbuilder.hxx                     |    6 ++--
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |    5 ++-
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx          |    8 ++---
 xmlhelp/source/cxxhelp/provider/databases.cxx            |    3 --
 14 files changed, 57 insertions(+), 48 deletions(-)

New commits:
commit 0cfb4aa2623b1606bbc66ef16256315778143227
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sat Jan 13 19:13:00 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat Jan 13 22:53:50 2024 +0100

    cid#1546354 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1546319 COPY_INSTEAD_OF_MOVE
    cid#1546286 COPY_INSTEAD_OF_MOVE
    cid#1546283 COPY_INSTEAD_OF_MOVE
    cid#1546191 COPY_INSTEAD_OF_MOVE
    cid#1545953 COPY_INSTEAD_OF_MOVE
    cid#1545874 COPY_INSTEAD_OF_MOVE
    cid#1545857 COPY_INSTEAD_OF_MOVE
    cid#1545781 COPY_INSTEAD_OF_MOVE
    cid#1545765 COPY_INSTEAD_OF_MOVE
    cid#1545546 COPY_INSTEAD_OF_MOVE
    cid#1545338 COPY_INSTEAD_OF_MOVE
    cid#1545190 COPY_INSTEAD_OF_MOVE
    cid#1545272 COPY_INSTEAD_OF_MOVE
    cid#1545242 COPY_INSTEAD_OF_MOVE
    cid#1545229 COPY_INSTEAD_OF_MOVE
    
    Change-Id: I88813d9dbd87ce10375db8198028f8b70e23f0fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162027
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/chart2/source/model/main/ChartModel.cxx 
b/chart2/source/model/main/ChartModel.cxx
index 19fccff373e9..6c4fe2dfa658 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -159,17 +159,20 @@ ChartModel::ChartModel( const ChartModel & rOther )
         if (rOther.m_xDiagram.is())
             xNewDiagram = new ::chart::Diagram( *rOther.m_xDiagram );
         rtl::Reference< ::chart::PageBackground > xNewPageBackground = new 
PageBackground( *rOther.m_xPageBackground );
-        rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager; // does 
not implement XCloneable
-        rtl::Reference< ::chart::NameContainer > xXMLNamespaceMap = new 
NameContainer( *rOther.m_xXMLNamespaceMap );
 
         {
-            MutexGuard aGuard( m_aModelMutex );
-            xListener = this;
-            m_xTitle = xNewTitle;
-            m_xDiagram = xNewDiagram;
-            m_xPageBackground = xNewPageBackground;
-            m_xChartTypeManager = xChartTypeManager;
-            m_xXMLNamespaceMap = xXMLNamespaceMap;
+            rtl::Reference< ::chart::ChartTypeManager > xChartTypeManager; // 
does not implement XCloneable
+            rtl::Reference< ::chart::NameContainer > xXMLNamespaceMap = new 
NameContainer( *rOther.m_xXMLNamespaceMap );
+
+            {
+                MutexGuard aGuard( m_aModelMutex );
+                xListener = this;
+                m_xTitle = xNewTitle;
+                m_xDiagram = xNewDiagram;
+                m_xPageBackground = std::move(xNewPageBackground);
+                m_xChartTypeManager = std::move(xChartTypeManager);
+                m_xXMLNamespaceMap = std::move(xXMLNamespaceMap);
+            }
         }
 
         ModifyListenerHelper::addListener( xNewTitle, xListener );
diff --git a/chart2/source/model/main/Diagram.cxx 
b/chart2/source/model/main/Diagram.cxx
index 99065d8910c5..2a4b63c73401 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -1098,11 +1098,11 @@ static bool lcl_moveSeriesOrCheckIfMoveIsAllowed(
                                         std::vector< rtl::Reference< 
DataSeries > > aOtherSeriesList = xOtherChartType->getDataSeries2();
                                         if( !aOtherSeriesList.empty() )
                                         {
-                                            rtl::Reference< DataSeries > 
xExchangeSeries( aOtherSeriesList[0] );
+                                            rtl::Reference<DataSeries> 
xExchangeSeries(aOtherSeriesList[0]);
                                             aOtherSeriesList[0] = 
xGivenDataSeries;
                                             
xOtherChartType->setDataSeries(aOtherSeriesList);
 
-                                            
aSeriesList[nOldSeriesIndex]=xExchangeSeries;
+                                            aSeriesList[nOldSeriesIndex] = 
std::move(xExchangeSeries);
                                             
xCurrentChartType->setDataSeries(aSeriesList);
                                         }
                                     }
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx 
b/chart2/source/view/charttypes/CandleStickChart.cxx
index 3082a6d031b1..4610c3389d7b 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -200,9 +200,7 @@ void CandleStickChart::createShapes()
                     drawing::Position3D aPosMiddleMinimum( 
pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Min ,0 ,true ) );
                     drawing::Position3D aPosMiddleMaximum( 
pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Max ,0 ,true ) );
 
-                    rtl::Reference<SvxShapeGroupAnyD> xLossGainTarget( 
xGainTarget );
-                    if(bBlack)
-                        xLossGainTarget = xLossTarget;
+                    rtl::Reference<SvxShapeGroupAnyD> xLossGainTarget(bBlack ? 
xLossTarget : xGainTarget);
 
                     uno::Reference< beans::XPropertySet > xPointProp( 
pSeries->getPropertiesOfPoint( nIndex ));
                     rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes;
diff --git a/connectivity/source/manager/mdrivermanager.cxx 
b/connectivity/source/manager/mdrivermanager.cxx
index 5c283be5d82d..ee80460621f5 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -591,8 +591,8 @@ Reference< XDriver > 
OSDBCDriverManager::implGetDriverForURL(const OUString& _rU
     {
         const OUString sDriverFactoryName = 
m_aDriverConfig.getDriverFactoryName(_rURL);
 
-        EqualDriverAccessToName aEqual(sDriverFactoryName);
-        DriverAccessArray::const_iterator aFind = 
std::find_if(m_aDriversBS.begin(),m_aDriversBS.end(),aEqual);
+        DriverAccessArray::const_iterator aFind = 
std::find_if(m_aDriversBS.begin(), m_aDriversBS.end(),
+                                                               
EqualDriverAccessToName(sDriverFactoryName));
         if ( aFind == m_aDriversBS.end() )
         {
             // search all bootstrapped drivers
diff --git a/framework/source/services/frame.cxx 
b/framework/source/services/frame.cxx
index 659578975a5e..34024b45f5ad 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -800,15 +800,17 @@ void SAL_CALL XFrameImpl::initialize( const 
css::uno::Reference< css::awt::XWind
 
     // create progress helper
     css::uno::Reference< css::frame::XFrame > xThis (this);
-    css::uno::Reference< css::task::XStatusIndicatorFactory > 
xIndicatorFactory =
-        css::task::StatusIndicatorFactory::createWithFrame(m_xContext, xThis,
-                                                           
false/*DisableReschedule*/, true/*AllowParentShow*/ );
+    {
+        css::uno::Reference< css::task::XStatusIndicatorFactory > 
xIndicatorFactory =
+            css::task::StatusIndicatorFactory::createWithFrame(m_xContext, 
xThis,
+                                                               
false/*DisableReschedule*/, true/*AllowParentShow*/ );
 
-    // SAFE -> ----------------------------------
-    aWriteLock.reset();
-    m_xIndicatorFactoryHelper = xIndicatorFactory;
-    aWriteLock.clear();
-    // <- SAFE ----------------------------------
+        // SAFE -> ----------------------------------
+        aWriteLock.reset();
+        m_xIndicatorFactoryHelper = std::move(xIndicatorFactory);
+        aWriteLock.clear();
+        // <- SAFE ----------------------------------
+    }
 
     // Start listening for events after setting it on helper class ...
     // So superfluous messages are filtered to NULL :-)
diff --git a/include/oox/helper/refvector.hxx b/include/oox/helper/refvector.hxx
index 8e60c20798b8..61bd04344080 100644
--- a/include/oox/helper/refvector.hxx
+++ b/include/oox/helper/refvector.hxx
@@ -58,9 +58,9 @@ public:
         skips all elements that are empty references. */
     template< typename FunctorType >
     void                forEach( FunctorType aFunctor ) const
-                        {
-                            ::std::for_each( this->begin(), this->end(), 
ForEachFunctor< FunctorType >( aFunctor ) );
-                        }
+    {
+        std::for_each(this->begin(), this->end(), 
ForEachFunctor<FunctorType>(std::move(aFunctor)));
+    }
 
     /** Calls the passed member function of ObjType on every contained object,
         automatically skips all elements that are empty references. */
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index d87c689f8eeb..3f52d15032e7 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -162,11 +162,11 @@ bool VbaProject::importVbaProject( StorageBase& 
rVbaPrjStrg )
        Reference< css::frame::XController > xController =  
mxDocModel->getCurrentController();
        xFrame =  xController.is() ? xController->getFrame() : nullptr;
    }
-   StorageRef noStorage;
+
    // if the GraphicHelper tries to use noStorage it will of course crash
    // but... this shouldn't happen as there is no reason for GraphicHelper
    // to do that when importing VBA projects
-   GraphicHelper grfHlp( mxContext, xFrame, noStorage );
+   GraphicHelper grfHlp(mxContext, xFrame, StorageRef());
    importVbaProject( rVbaPrjStrg, grfHlp );
    // return true if something has been imported
    return (mxBasicLib.is() && mxBasicLib->hasElements()) ||
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 59b9b8c78117..4df322def537 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2374,15 +2374,17 @@ bool ScColumn::UpdateReference( sc::RefUpdateContext& 
rCxt, ScDocument* pUndoDoc
 
     // Check the row positions at which the group must be split per relative
     // references.
-    UpdateRefGroupBoundChecker aBoundChecker(rCxt, aBounds);
-    std::for_each(maCells.begin(), maCells.end(), aBoundChecker);
+    {
+        UpdateRefGroupBoundChecker aBoundChecker(rCxt, aBounds);
+        std::for_each(maCells.begin(), maCells.end(), 
std::move(aBoundChecker));
+    }
 
     // If expand reference edges is on, splitting groups may happen anywhere
     // where a reference points to an adjacent row of the insertion.
     if (rCxt.mnRowDelta > 0 && rCxt.mrDoc.IsExpandRefs())
     {
         UpdateRefExpandGroupBoundChecker aExpandChecker(rCxt, aBounds);
-        std::for_each(maCells.begin(), maCells.end(), aExpandChecker);
+        std::for_each(maCells.begin(), maCells.end(), 
std::move(aExpandChecker));
     }
 
     // Do the actual splitting.
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 69b29239a1cc..47fc047909e9 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1043,8 +1043,10 @@ void ScTable::SortReorderByColumn(
         // once.
         std::sort(aListeners.begin(), aListeners.end());
         aListeners.erase(std::unique(aListeners.begin(), aListeners.end()), 
aListeners.end());
-        ReorderNotifier<sc::RefColReorderHint, sc::ColRowReorderMapType, 
SCCOL> aFunc(aColMap, nTab, nRow1, nRow2);
-        std::for_each(aListeners.begin(), aListeners.end(), aFunc);
+        {
+            ReorderNotifier<sc::RefColReorderHint, sc::ColRowReorderMapType, 
SCCOL> aFunc(aColMap, nTab, nRow1, nRow2);
+            std::for_each(aListeners.begin(), aListeners.end(), 
std::move(aFunc));
+        }
 
         // Re-start area listeners on the reordered columns.
         {
@@ -1474,8 +1476,10 @@ void ScTable::SortReorderByRowRefUpdate(
     }
 
     // Notify the listeners to update their references.
-    ReorderNotifier<sc::RefRowReorderHint, sc::ColRowReorderMapType, SCROW> 
aFunc(aRowMap, nTab, nCol1, nCol2);
-    std::for_each(aListeners.begin(), aListeners.end(), aFunc);
+    {
+        ReorderNotifier<sc::RefRowReorderHint, sc::ColRowReorderMapType, 
SCROW> aFunc(aRowMap, nTab, nCol1, nCol2);
+        std::for_each(aListeners.begin(), aListeners.end(), std::move(aFunc));
+    }
 
     // Re-group formulas in affected columns.
     for (const auto& [rTab, rCols] : rGroupTabs)
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 10dafddc81a5..c57af43642da 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -1830,7 +1830,7 @@ void SAL_CALL PersistentPropertySet::setPropertyValues(
                             aEvt.PropertyName   = rNewValue.Name;
                             aEvt.PropertyHandle = rNewValue.Handle;
                             aEvt.Further        = false;
-                            aEvt.OldValue       = aOldValue;
+                            aEvt.OldValue       = std::move(aOldValue);
                             aEvt.NewValue       = rNewValue.Value;
 
                             aEvents.push_back( aEvt );
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 461926c460d1..f0daa2a78323 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -169,10 +169,10 @@ public:
     void flush() { mpIdleNotify->Invoke(); }
 
 protected:
-    void initializeSender(VclPtr<vcl::Window> aNotifierWindow, 
VclPtr<vcl::Window> aContentWindow,
-                          const OUString& sTypeOfJSON)
+    void initializeSender(const VclPtr<vcl::Window>& rNotifierWindow,
+                          const VclPtr<vcl::Window>& rContentWindow, const 
OUString& rTypeOfJSON)
     {
-        mpIdleNotify.reset(new JSDialogNotifyIdle(aNotifierWindow, 
aContentWindow, sTypeOfJSON));
+        mpIdleNotify.reset(new JSDialogNotifyIdle(rNotifierWindow, 
rContentWindow, rTypeOfJSON));
     }
 };
 
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 490dd921ced3..e66c0e50c0ad 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -1138,9 +1138,10 @@ void 
DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag
                 }
                 OUString sParaStyleName;
                 rParaProp.m_rPropertySet->getPropertyValue("ParaStyleName") 
>>= sParaStyleName;
-                StyleSheetEntryPtr pEntry = 
m_rDMapper_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(sParaStyleName);
                 bool bDocDefault;
-                uno::Any aParaStyle = 
m_rDMapper_Impl.GetPropertyFromStyleSheet(eId, pEntry, true, true, 
&bDocDefault);
+                uno::Any aParaStyle = 
m_rDMapper_Impl.GetPropertyFromStyleSheet(eId,
+                        
m_rDMapper_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(sParaStyleName),
+                        true, true, &bDocDefault);
                 // A very strange compatibility rule says that the DEFAULT 
style's specified fontsize of 11 or 12
                 // or a specified left justify will always be overridden by 
the table-style.
                 // Normally this rule is applied, so always do this unless a 
compatSetting indicates otherwise.
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index d85c3f9b4643..682fe97dae98 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -336,13 +336,13 @@ void OOXMLDocumentImpl::resolveComment(Stream & rStream,
 OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet
 (const OUString & rId)
 {
-    OOXMLStream::Pointer_t pStream
+    OOXMLStream::Pointer_t xStream
         (OOXMLDocumentFactory::createStream(mpStream, rId));
 
-    writerfilter::Reference<BinaryObj>::Pointer_t pPicture
-        (new OOXMLBinaryObjectReference(pStream));
+    writerfilter::Reference<BinaryObj>::Pointer_t xPicture
+        (new OOXMLBinaryObjectReference(std::move(xStream)));
 
-    OOXMLValue::Pointer_t pPayloadValue(new OOXMLBinaryValue(pPicture));
+    OOXMLValue::Pointer_t pPayloadValue(new 
OOXMLBinaryValue(std::move(xPicture)));
 
     OOXMLPropertySet::Pointer_t pBlipSet(new OOXMLPropertySet);
 
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx 
b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 1969c1d3908c..cc05fb69ea29 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -789,8 +789,7 @@ KeywordInfo* Databases::getKeyword( const OUString& 
Database,
 
         // sorting
         Reference<XCollator> xCollator = getCollator(aGuard, Language);
-        KeywordElementComparator aComparator( xCollator );
-        std::sort(aVector.begin(),aVector.end(),aComparator);
+        std::sort(aVector.begin(), aVector.end(), 
KeywordElementComparator(xCollator));
 
         it->second.reset(new KeywordInfo( aVector ));
     }

Reply via email to