summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-13 19:13:00 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-13 22:53:50 +0100
commit0cfb4aa2623b1606bbc66ef16256315778143227 (patch)
tree5ef4a223848af74e7a4e22996174f7aedfc43d71 /chart2/source/model
parentd3963918544888608da149c3f0206d7a96828361 (diff)
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 <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'chart2/source/model')
-rw-r--r--chart2/source/model/main/ChartModel.cxx21
-rw-r--r--chart2/source/model/main/Diagram.cxx4
2 files changed, 14 insertions, 11 deletions
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);
}
}