diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 20:38:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-11 12:18:47 +0200 |
commit | ea014c324a9f5fff344c3fccdfcb0e5bcbe75d81 (patch) | |
tree | 9652136b3b3bfc58f3515f9e261af6a561170f7c /chart2/source/tools | |
parent | c7f8a54e05dab430cf2f5b3e1fa90e729c7a5601 (diff) |
loplugin:moveparam in chart2
Change-Id: I6a47abf80f0f45bbb55bc9e0fe817f3c3650aff3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123351
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r-- | chart2/source/tools/InternalData.cxx | 16 | ||||
-rw-r--r-- | chart2/source/tools/InternalDataProvider.cxx | 40 |
2 files changed, 28 insertions, 28 deletions
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx index 1f5bcddc6c82..b93dbe33ae88 100644 --- a/chart2/source/tools/InternalData.cxx +++ b/chart2/source/tools/InternalData.cxx @@ -194,7 +194,7 @@ void InternalData::setRowValues( sal_Int32 nRowIndex, const vector< double > & r m_aData[ std::slice( nRowIndex*m_nColumnCount, m_nColumnCount, 1 ) ]= aSlice; } -void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector< uno::Any >& rComplexLabel ) +void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, vector< uno::Any >&& rComplexLabel ) { if( nColumnIndex < 0 ) return; @@ -203,12 +203,12 @@ void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector< m_aColumnLabels.resize(nColumnIndex+1); enlargeData( nColumnIndex+1, 0 ); } - m_aColumnLabels[nColumnIndex]=rComplexLabel; + m_aColumnLabels[nColumnIndex] = std::move(rComplexLabel); dump(); } -void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< uno::Any >& rComplexLabel ) +void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, vector< uno::Any >&& rComplexLabel ) { if( nRowIndex < 0 ) return; @@ -225,7 +225,7 @@ void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< uno::A } else { - m_aRowLabels[nRowIndex] = rComplexLabel; + m_aRowLabels[nRowIndex] = std::move(rComplexLabel); } } @@ -468,9 +468,9 @@ void InternalData::deleteRow( sal_Int32 nAtIndex ) dump(); } -void InternalData::setComplexRowLabels( const tVecVecAny& rNewRowLabels ) +void InternalData::setComplexRowLabels( tVecVecAny&& rNewRowLabels ) { - m_aRowLabels = rNewRowLabels; + m_aRowLabels = std::move(rNewRowLabels); sal_Int32 nNewRowCount = static_cast< sal_Int32 >( m_aRowLabels.size() ); if( nNewRowCount < m_nRowCount ) m_aRowLabels.resize( m_nRowCount ); @@ -483,9 +483,9 @@ const InternalData::tVecVecAny& InternalData::getComplexRowLabels() const return m_aRowLabels; } -void InternalData::setComplexColumnLabels( const tVecVecAny& rNewColumnLabels ) +void InternalData::setComplexColumnLabels( tVecVecAny&& rNewColumnLabels ) { - m_aColumnLabels = rNewColumnLabels; + m_aColumnLabels = std::move(rNewColumnLabels); sal_Int32 nNewColumnCount = static_cast< sal_Int32 >( m_aColumnLabels.size() ); if( nNewColumnCount < m_nColumnCount ) m_aColumnLabels.resize( m_nColumnCount ); diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index abbcc077e1c0..ccbf8697c638 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -374,9 +374,9 @@ InternalDataProvider::InternalDataProvider( } if( m_bDataInColumns ) - m_aInternalData.setComplexRowLabels( aNewCategories ); + m_aInternalData.setComplexRowLabels( std::move(aNewCategories) ); else - m_aInternalData.setComplexColumnLabels( aNewCategories ); + m_aInternalData.setComplexColumnLabels( std::move(aNewCategories) ); if( bConnectToModel ) DiagramHelper::setCategoriesToDiagram( new LabeledDataSequence( createDataSequenceByRangeRepresentation( lcl_aCategoriesRangeName )), xDiagram ); @@ -633,7 +633,7 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, st } std::vector<uno::Any> aLabels(1, bStoreNumeric ? uno::Any(fValue) : uno::Any(aRawElems[i])); - m_aInternalData.setComplexRowLabel(i, aLabels); + m_aInternalData.setComplexRowLabel(i, std::move(aLabels)); } xSeq.set(new UncachedDataSequence(this, lcl_aCategoriesRangeName)); @@ -647,7 +647,7 @@ InternalDataProvider::createDataSequenceFromArray( const OUString& rArrayStr, st if (!aRawElems.empty() && nColSize) { std::vector<uno::Any> aLabels(1, uno::Any(aRawElems[0])); - m_aInternalData.setComplexColumnLabel(nColSize-1, aLabels); + m_aInternalData.setComplexColumnLabel(nColSize-1, std::move(aLabels)); OUString aRangeRep = lcl_aLabelRangePrefix + OUString::number(nColSize-1); xSeq.set(new UncachedDataSequence(this, aRangeRep)); @@ -956,17 +956,17 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation( { sal_uInt32 nIndex = aRange.copy( strlen(lcl_aLabelRangePrefix)).toInt32(); if( m_bDataInColumns ) - m_aInternalData.setComplexColumnLabel( nIndex, aNewVector ); + m_aInternalData.setComplexColumnLabel( nIndex, std::move(aNewVector) ); else - m_aInternalData.setComplexRowLabel( nIndex, aNewVector ); + m_aInternalData.setComplexRowLabel( nIndex, std::move(aNewVector) ); } else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) ) { sal_Int32 nPointIndex = aRange.copy( strlen(lcl_aCategoriesLevelRangeNamePrefix)).toInt32(); if( m_bDataInColumns ) - m_aInternalData.setComplexRowLabel( nPointIndex, aNewVector ); + m_aInternalData.setComplexRowLabel( nPointIndex, std::move(aNewVector) ); else - m_aInternalData.setComplexColumnLabel( nPointIndex, aNewVector ); + m_aInternalData.setComplexColumnLabel( nPointIndex, std::move(aNewVector) ); } else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) ) { @@ -983,9 +983,9 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation( aComplexCategories.begin(), lcl_setAnyAtLevel(nLevel) ); if( m_bDataInColumns ) - m_aInternalData.setComplexRowLabels( aComplexCategories ); + m_aInternalData.setComplexRowLabels( std::move(aComplexCategories) ); else - m_aInternalData.setComplexColumnLabels( aComplexCategories ); + m_aInternalData.setComplexColumnLabels( std::move(aComplexCategories) ); } else if( aRange == lcl_aCategoriesRangeName ) { @@ -994,9 +994,9 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation( transform( aComplexCategories.begin(), aComplexCategories.end(), aNewVector.begin(), aComplexCategories.begin(), lcl_setAnyAtLevel(0) ); if( m_bDataInColumns ) - m_aInternalData.setComplexRowLabels( aComplexCategories ); + m_aInternalData.setComplexRowLabels( std::move(aComplexCategories) ); else - m_aInternalData.setComplexColumnLabels( aComplexCategories ); + m_aInternalData.setComplexColumnLabels( std::move(aComplexCategories) ); } else { @@ -1060,9 +1060,9 @@ void SAL_CALL InternalDataProvider::insertComplexCategoryLevel( sal_Int32 nLevel vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels(); std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_insertAnyAtLevel(nLevel) ); if( m_bDataInColumns ) - m_aInternalData.setComplexRowLabels( aComplexCategories ); + m_aInternalData.setComplexRowLabels( std::move(aComplexCategories) ); else - m_aInternalData.setComplexColumnLabels( aComplexCategories ); + m_aInternalData.setComplexColumnLabels( std::move(aComplexCategories) ); tSequenceMapRange aRange( m_aSequenceMap.equal_range( lcl_aCategoriesRangeName )); std::for_each( aRange.first, aRange.second, lcl_setModified()); @@ -1076,9 +1076,9 @@ void SAL_CALL InternalDataProvider::deleteComplexCategoryLevel( sal_Int32 nLevel vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels(); std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_removeAnyAtLevel(nLevel) ); if( m_bDataInColumns ) - m_aInternalData.setComplexRowLabels( aComplexCategories ); + m_aInternalData.setComplexRowLabels( std::move(aComplexCategories) ); else - m_aInternalData.setComplexColumnLabels( aComplexCategories ); + m_aInternalData.setComplexColumnLabels( std::move(aComplexCategories) ); tSequenceMapRange aRange( m_aSequenceMap.equal_range( lcl_aCategoriesRangeName )); std::for_each( aRange.first, aRange.second, lcl_setModified()); @@ -1402,9 +1402,9 @@ void SAL_CALL InternalDataProvider::setDateCategories( const Sequence< double >& } if( m_bDataInColumns ) - m_aInternalData.setComplexRowLabels( aNewCategories ); + m_aInternalData.setComplexRowLabels( std::move(aNewCategories) ); else - m_aInternalData.setComplexColumnLabels( aNewCategories ); + m_aInternalData.setComplexColumnLabels( std::move(aNewCategories) ); } // ____ XAnyDescriptionAccess ____ @@ -1459,7 +1459,7 @@ void SAL_CALL InternalDataProvider::setRowDescriptions( const Sequence< OUString vector< vector< uno::Any > > aComplexDescriptions( aRowDescriptions.getLength() ); transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aRowDescriptions.getConstArray(), aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) ); - m_aInternalData.setComplexRowLabels( aComplexDescriptions ); + m_aInternalData.setComplexRowLabels( std::move(aComplexDescriptions) ); } void SAL_CALL InternalDataProvider::setColumnDescriptions( const Sequence< OUString >& aColumnDescriptions ) @@ -1467,7 +1467,7 @@ void SAL_CALL InternalDataProvider::setColumnDescriptions( const Sequence< OUStr vector< vector< uno::Any > > aComplexDescriptions( aColumnDescriptions.getLength() ); transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aColumnDescriptions.getConstArray(), aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) ); - m_aInternalData.setComplexColumnLabels( aComplexDescriptions ); + m_aInternalData.setComplexColumnLabels( std::move(aComplexDescriptions) ); } Sequence< OUString > SAL_CALL InternalDataProvider::getRowDescriptions() |