diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 19:59:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 21:03:18 +0200 |
commit | f67392948d625db9ce115092e4c9bfd301268a25 (patch) | |
tree | 0bd1490ad019c3c172229e8990c62262c3f557fe /xmloff/source | |
parent | 210bbdead214531172d74d0d2975f47cf973bc69 (diff) |
loplugin:moveparam in xmloff
Change-Id: I46c1c8dc46cd2b8470b69506f6609f8bd7e42211
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 52 | ||||
-rw-r--r-- | xmloff/source/core/RDFaImportHelper.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/forms/layerexport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/XMLPageExport.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/style/impastpl.cxx | 20 | ||||
-rw-r--r-- | xmloff/source/style/impastpl.hxx | 10 | ||||
-rw-r--r-- | xmloff/source/style/xmlaustp.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/table/XMLTableExport.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 8 |
12 files changed, 68 insertions, 70 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 9c97c64a5a29..54a2879d4f2d 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -496,12 +496,10 @@ struct NewDonutSeries }; void lcl_swapPointAndSeriesStylesForDonutCharts( ::std::vector< DataRowPointStyle >& rStyleVector - , const ::std::map< css::uno::Reference< css::chart2::XDataSeries> , sal_Int32 >& rSeriesMap ) + , ::std::map< css::uno::Reference< css::chart2::XDataSeries> , sal_Int32 >&& aSeriesMap ) { //detect old series count //and add old series to aSeriesMap - ::std::map< css::uno::Reference< - css::chart2::XDataSeries >, sal_Int32 > aSeriesMap(rSeriesMap); sal_Int32 nOldSeriesCount = 0; { sal_Int32 nMaxOldSeriesIndex = 0; diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 68e23a5616a9..b230a924472c 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -204,7 +204,7 @@ public: */ ::std::queue< OUString > maAutoStyleNameQueue; void CollectAutoStyle( - const std::vector< XMLPropertyState >& aStates ); + std::vector< XMLPropertyState >&& aStates ); void AddAutoStyleAttribute( const std::vector< XMLPropertyState >& aStates ); @@ -1296,7 +1296,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } // remove property states for autostyles aPropertyStates.clear(); @@ -1335,7 +1335,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } // remove property states for autostyles aPropertyStates.clear(); @@ -1376,7 +1376,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } // remove property states for autostyles aPropertyStates.clear(); @@ -1481,7 +1481,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } // remove property states for autostyles aPropertyStates.clear(); @@ -1997,7 +1997,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } // remove property states for autostyles aPropertyStates.clear(); @@ -2033,7 +2033,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( } else { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } } } @@ -2055,7 +2055,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( } else { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } } } @@ -2077,7 +2077,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( } else { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } } } @@ -2110,7 +2110,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } } } @@ -2138,7 +2138,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } } @@ -2235,7 +2235,7 @@ void SchXMLExportHelper_Impl::exportAxisTitle( const Reference< beans::XProperty } else { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } aPropertyStates.clear(); } @@ -2253,7 +2253,7 @@ void SchXMLExportHelper_Impl::exportGrid( const Reference< beans::XPropertySet > } else { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } aPropertyStates.clear(); } @@ -2384,7 +2384,7 @@ void SchXMLExportHelper_Impl::exportAxis( } else { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } aPropertyStates.clear(); @@ -2862,7 +2862,7 @@ void SchXMLExportHelper_Impl::exportSeries( } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } // remove property states for autostyles aPropertyStates.clear(); @@ -2955,7 +2955,7 @@ void SchXMLExportHelper_Impl::exportSeries( } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } } } @@ -3003,7 +3003,7 @@ void SchXMLExportHelper_Impl::exportSeries( { // add the style for the to be <chart:data-label> too if (!aDataLabelPropertyStates.empty()) - CollectAutoStyle(aDataLabelPropertyStates); + CollectAutoStyle(std::move(aDataLabelPropertyStates)); } aDataLabelPropertyStates.clear(); @@ -3161,11 +3161,11 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( { if( !aPropertyStates.empty()) { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } if( bExportEquation && !aEquationPropertyStates.empty()) { - CollectAutoStyle( aEquationPropertyStates ); + CollectAutoStyle( std::move(aEquationPropertyStates) ); } } } @@ -3245,7 +3245,7 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe } else // autostyles { - CollectAutoStyle( aPropertyStates ); + CollectAutoStyle( std::move(aPropertyStates) ); } } @@ -3504,9 +3504,9 @@ void SchXMLExportHelper_Impl::exportDataPoints( else { if (!aPropertyStates.empty()) - CollectAutoStyle(aPropertyStates); + CollectAutoStyle(std::move(aPropertyStates)); if (!aDataLabelPropertyStates.empty()) - CollectAutoStyle(aDataLabelPropertyStates); + CollectAutoStyle(std::move(aDataLabelPropertyStates)); } } } @@ -3591,9 +3591,9 @@ void SchXMLExportHelper_Impl::exportDataPoints( else { if (!aPropertyStates.empty()) - CollectAutoStyle(aPropertyStates); + CollectAutoStyle(std::move(aPropertyStates)); if (!aDataLabelPropertyStates.empty()) - CollectAutoStyle(aDataLabelPropertyStates); + CollectAutoStyle(std::move(aDataLabelPropertyStates)); } continue; } @@ -3773,10 +3773,10 @@ awt::Size SchXMLExportHelper_Impl::getPageSize( const Reference< chart2::XChartD return aSize; } -void SchXMLExportHelper_Impl::CollectAutoStyle( const std::vector< XMLPropertyState >& aStates ) +void SchXMLExportHelper_Impl::CollectAutoStyle( std::vector< XMLPropertyState >&& aStates ) { if( !aStates.empty() ) - maAutoStyleNameQueue.push( mrAutoStylePool.Add( XmlStyleFamily::SCH_CHART_ID, aStates )); + maAutoStyleNameQueue.push( mrAutoStylePool.Add( XmlStyleFamily::SCH_CHART_ID, std::move(aStates) )); } void SchXMLExportHelper_Impl::AddAutoStyleAttribute( const std::vector< XMLPropertyState >& aStates ) diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx index 42b8c2e412d7..0dddb882207a 100644 --- a/xmloff/source/core/RDFaImportHelper.cxx +++ b/xmloff/source/core/RDFaImportHelper.cxx @@ -116,11 +116,11 @@ struct ParsedRDFaAttributes ParsedRDFaAttributes( OUString const & i_rAbout, - ::std::vector< OUString > const & i_rProperties, + ::std::vector< OUString >&& i_rProperties, OUString const & i_rContent, OUString const & i_rDatatype) : m_About(i_rAbout) - , m_Properties(i_rProperties) + , m_Properties(std::move(i_rProperties)) , m_Content(i_rContent) , m_Datatype(i_rDatatype) { } @@ -384,7 +384,7 @@ RDFaImportHelper::ParseRDFa( if (about.isEmpty()) { return std::shared_ptr<ParsedRDFaAttributes>(); } - const ::std::vector< OUString > properties( + ::std::vector< OUString > properties( reader.ReadCURIEs(i_rProperty) ); if (properties.empty()) { return std::shared_ptr<ParsedRDFaAttributes>(); @@ -393,7 +393,7 @@ RDFaImportHelper::ParseRDFa( ? reader.ReadCURIE(i_rDatatype) : OUString() ); return std::make_shared<ParsedRDFaAttributes>( - about, properties, i_rContent, datatype); + about, std::move(properties), i_rContent, datatype); } void diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 933a280739d5..a306236ac13e 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -1539,7 +1539,7 @@ OUString SdXMLExport::ImpCreatePresPageStyleName( const Reference<XDrawPage>& xD if(sStyleName.isEmpty()) { // Style did not exist, add it to AutoStalePool - sStyleName = GetAutoStylePool()->Add(XmlStyleFamily::SD_DRAWINGPAGE_ID, sStyleName, aPropStates); + sStyleName = GetAutoStylePool()->Add(XmlStyleFamily::SD_DRAWINGPAGE_ID, sStyleName, std::move(aPropStates)); } } } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index c00886f386e8..8cf4992340e1 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -436,7 +436,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap if(aShapeInfo.msStyleName.isEmpty()) { // Style did not exist, add it to AutoStalePool - aShapeInfo.msStyleName = mrExport.GetAutoStylePool()->Add(aShapeInfo.mnFamily, aParentName, aPropStates); + aShapeInfo.msStyleName = mrExport.GetAutoStylePool()->Add(aShapeInfo.mnFamily, aParentName, std::move(aPropStates)); } } @@ -485,7 +485,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap if(aShapeInfo.msTextStyleName.isEmpty()) { // Style did not exist, add it to AutoStalePool - aShapeInfo.msTextStyleName = mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TEXT_PARAGRAPH, "", aPropStates); + aShapeInfo.msTextStyleName = mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TEXT_PARAGRAPH, "", std::move(aPropStates)); } } } diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index c6d9edf17378..dc2d3221ad11 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -590,7 +590,7 @@ namespace xmloff if ( !aPropertyStates.empty() ) { // add to the style pool - OUString sColumnStyleName = m_rContext.GetAutoStylePool()->Add( XmlStyleFamily::CONTROL_ID, aPropertyStates ); + OUString sColumnStyleName = m_rContext.GetAutoStylePool()->Add( XmlStyleFamily::CONTROL_ID, std::move(aPropertyStates) ); OSL_ENSURE( m_aGridColumnStyles.end() == m_aGridColumnStyles.find( xColumnProperties ), "OFormLayerXMLExport_Impl::collectGridColumnStylesAndIds: already have a style for this column!" ); diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index b9f3c95a47d6..87de784951cb 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -78,12 +78,12 @@ void XMLPageExport::collectPageMasterAutoStyle( rEntry.sPageMasterName = rExport.GetAutoStylePool()->Find( XmlStyleFamily::PAGE_MASTER, sParent, aPropStates ); if (rEntry.sPageMasterName.isEmpty()) { - rEntry.sPageMasterName = rExport.GetAutoStylePool()->Add(XmlStyleFamily::PAGE_MASTER, sParent, aPropStates); + rEntry.sPageMasterName = rExport.GetAutoStylePool()->Add(XmlStyleFamily::PAGE_MASTER, sParent, std::move(aPropStates)); } } } assert(m_xPageMasterDrawingPageExportPropMapper.is()); - ::std::vector<XMLPropertyState> const aPropStates( + ::std::vector<XMLPropertyState> aPropStates( m_xPageMasterDrawingPageExportPropMapper->Filter(rExport, rPropSet)); if (!aPropStates.empty()) { @@ -91,7 +91,7 @@ void XMLPageExport::collectPageMasterAutoStyle( rEntry.sDrawingPageStyleName = rExport.GetAutoStylePool()->Find(XmlStyleFamily::SD_DRAWINGPAGE_ID, sParent, aPropStates); if (rEntry.sDrawingPageStyleName.isEmpty()) { - rEntry.sDrawingPageStyleName = rExport.GetAutoStylePool()->Add(XmlStyleFamily::SD_DRAWINGPAGE_ID, sParent, aPropStates); + rEntry.sDrawingPageStyleName = rExport.GetAutoStylePool()->Add(XmlStyleFamily::SD_DRAWINGPAGE_ID, sParent, std::move(aPropStates)); } } } diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index c61f9351ffc3..fd7c84dc1642 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -148,8 +148,8 @@ static OUString any2string(const uno::Any& any) // Class SvXMLAutoStylePoolProperties_Impl // ctor class SvXMLAutoStylePoolProperties_Impl -XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString const & rParentName ) -: maProperties( rProperties ), +XMLAutoStylePoolProperties::XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFamilyData, vector< XMLPropertyState >&& rProperties, OUString const & rParentName ) +: maProperties( std::move(rProperties) ), mnPos ( rFamilyData.mnCount ) { static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr); @@ -272,7 +272,7 @@ struct ComparePartial // Adds an array of XMLPropertyState ( vector< XMLPropertyState > ) to list // if not added, yet. -bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek ) +bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, vector< XMLPropertyState >&& rProperties, OUString& rName, bool bDontSeek ) { XMLAutoStylePoolProperties *pProperties = nullptr; auto [itBegin, itEnd] = std::equal_range(m_PropertiesList.begin(), m_PropertiesList.end(), rProperties, ComparePartial{rFamilyData}); @@ -284,7 +284,7 @@ bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< bool bAdded = false; if( bDontSeek || !pProperties ) { - pProperties = new XMLAutoStylePoolProperties( rFamilyData, rProperties, msParent ); + pProperties = new XMLAutoStylePoolProperties( rFamilyData, std::move(rProperties), msParent ); m_PropertiesList.insert(itBegin, std::unique_ptr<XMLAutoStylePoolProperties>(pProperties)); bAdded = true; } @@ -300,7 +300,7 @@ bool XMLAutoStylePoolParent::Add( XMLAutoStyleFamily& rFamilyData, const vector< // the same properties exists, a new one is added (like with bDontSeek). -bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName ) +bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, vector< XMLPropertyState >&& rProperties, const OUString& rName ) { if (rFamilyData.maNameSet.find(rName) != rFamilyData.maNameSet.end()) return false; @@ -308,7 +308,7 @@ bool XMLAutoStylePoolParent::AddNamed( XMLAutoStyleFamily& rFamilyData, const ve auto it = std::lower_bound(m_PropertiesList.begin(), m_PropertiesList.end(), rProperties, ComparePartial{rFamilyData}); std::unique_ptr<XMLAutoStylePoolProperties> pProperties( - new XMLAutoStylePoolProperties(rFamilyData, rProperties, msParent)); + new XMLAutoStylePoolProperties(rFamilyData, std::move(rProperties), msParent)); // ignore the generated name pProperties->SetName( rName ); m_PropertiesList.insert(it, std::move(pProperties)); @@ -453,7 +453,7 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames( bool SvXMLAutoStylePoolP_Impl::Add( OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, - const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek ) + ::std::vector< XMLPropertyState >&& rProperties, bool bDontSeek ) { XMLAutoStyleFamily aTemp(nFamily); auto const iter = m_FamilySet.find(aTemp); @@ -466,7 +466,7 @@ bool SvXMLAutoStylePoolP_Impl::Add( XMLAutoStylePoolParent& rParent = **itPair.first; bool bRet = false; - if (rParent.Add(rFamily, rProperties, rName, bDontSeek)) + if (rParent.Add(rFamily, std::move(rProperties), rName, bDontSeek)) { rFamily.mnCount++; bRet = true; @@ -477,7 +477,7 @@ bool SvXMLAutoStylePoolP_Impl::Add( bool SvXMLAutoStylePoolP_Impl::AddNamed( const OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, - const ::std::vector< XMLPropertyState >& rProperties ) + std::vector< XMLPropertyState >&& rProperties ) { // get family and parent the same way as in Add() @@ -492,7 +492,7 @@ bool SvXMLAutoStylePoolP_Impl::AddNamed( XMLAutoStylePoolParent& rParent = **itPair.first; bool bRet = false; - if (rParent.AddNamed(rFamily, rProperties, rName)) + if (rParent.AddNamed(rFamily, std::move(rProperties), rName)) { rFamily.mnCount++; bRet = true; diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx index 23ffed85728d..4645305e1dcb 100644 --- a/xmloff/source/style/impastpl.hxx +++ b/xmloff/source/style/impastpl.hxx @@ -49,7 +49,7 @@ class XMLAutoStylePoolProperties public: - XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, OUString const & rParentname ); + XMLAutoStylePoolProperties( XMLAutoStyleFamily& rFamilyData, std::vector< XMLPropertyState >&& rProperties, OUString const & rParentname ); const OUString& GetName() const { return msName; } const ::std::vector< XMLPropertyState >& GetProperties() const { return maProperties; } @@ -77,9 +77,9 @@ public: ~XMLAutoStylePoolParent(); - bool Add( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek ); + bool Add( XMLAutoStyleFamily& rFamilyData, std::vector< XMLPropertyState >&& rProperties, OUString& rName, bool bDontSeek ); - bool AddNamed( XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const OUString& rName ); + bool AddNamed( XMLAutoStyleFamily& rFamilyData, std::vector< XMLPropertyState >&& rProperties, const OUString& rName ); OUString Find( const XMLAutoStyleFamily& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const; @@ -158,13 +158,13 @@ public: bool Add( OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, - const ::std::vector< XMLPropertyState >& rProperties, + std::vector< XMLPropertyState >&& rProperties, bool bDontSeek = false ); bool AddNamed( const OUString& rName, XmlStyleFamily nFamily, const OUString& rParentName, - const ::std::vector< XMLPropertyState >& rProperties ); + std::vector< XMLPropertyState >&& rProperties ); OUString Find( XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const; diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx index d274884a7848..859477250ece 100644 --- a/xmloff/source/style/xmlaustp.cxx +++ b/xmloff/source/style/xmlaustp.cxx @@ -331,32 +331,32 @@ void SvXMLAutoStylePoolP::RegisterNames( } OUString SvXMLAutoStylePoolP::Add( XmlStyleFamily nFamily, - const vector< XMLPropertyState >& rProperties ) + vector< XMLPropertyState >&& rProperties ) { OUString sName; - pImpl->Add(sName, nFamily, "", rProperties ); + pImpl->Add(sName, nFamily, "", std::move(rProperties) ); return sName; } OUString SvXMLAutoStylePoolP::Add( XmlStyleFamily nFamily, const OUString& rParent, - const vector< XMLPropertyState >& rProperties, bool bDontSeek ) + vector< XMLPropertyState >&& rProperties, bool bDontSeek ) { OUString sName; - pImpl->Add(sName, nFamily, rParent, rProperties, bDontSeek); + pImpl->Add(sName, nFamily, rParent, std::move(rProperties), bDontSeek); return sName; } -bool SvXMLAutoStylePoolP::Add(OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) +bool SvXMLAutoStylePoolP::Add(OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, ::std::vector< XMLPropertyState >&& rProperties ) { - return pImpl->Add(rName, nFamily, rParent, rProperties); + return pImpl->Add(rName, nFamily, rParent, std::move(rProperties)); } bool SvXMLAutoStylePoolP::AddNamed( const OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, - const ::std::vector< XMLPropertyState >& rProperties ) + std::vector< XMLPropertyState >&& rProperties ) { - return pImpl->AddNamed(rName, nFamily, rParent, rProperties); + return pImpl->AddNamed(rName, nFamily, rParent, std::move(rProperties)); } OUString SvXMLAutoStylePoolP::Find( XmlStyleFamily nFamily, diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index c4baf426bf95..81488ec62543 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -239,7 +239,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if( has_states( aPropStates ) ) { - const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_COLUMN, aPropStates) ); + const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_COLUMN, std::move(aPropStates)) ); Reference< XInterface > xKey( xPropSet, UNO_QUERY ); xTableInfo->maColumnStyleMap[xKey] = sStyleName; } @@ -263,7 +263,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if( has_states( aRowPropStates ) ) { - const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_ROW, aRowPropStates) ); + const OUString sStyleName( mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_ROW, std::move(aRowPropStates)) ); Reference< XInterface > xKey( xPropSet, UNO_QUERY ); xTableInfo->maRowStyleMap[xKey] = sStyleName; } @@ -289,7 +289,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) OUString sStyleName; std::vector<XMLPropertyState> aCellPropStates(mxCellExportPropertySetMapper->Filter(mrExport, xCellSet)); if( has_states( aCellPropStates ) ) - sStyleName = mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_CELL, aCellPropStates); + sStyleName = mrExport.GetAutoStylePool()->Add(XmlStyleFamily::TABLE_CELL, std::move(aCellPropStates)); else sStyleName = sParentStyleName; diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 16822a03f09f..7257ac0061af 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -636,9 +636,9 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, } if (aPropStates.size() - nIgnoreProps) { - GetAutoStylePool().Add( nFamily, sParent, aPropStates, bDontSeek ); + GetAutoStylePool().Add( nFamily, sParent, std::vector(aPropStates), bDontSeek ); if( !sCondParent.isEmpty() && sParent != sCondParent ) - GetAutoStylePool().Add( nFamily, sCondParent, aPropStates ); + GetAutoStylePool().Add( nFamily, sCondParent, std::move(aPropStates) ); } } @@ -725,9 +725,9 @@ void XMLTextParagraphExport::Add( XmlStyleFamily nFamily, if( std::any_of( aPropStates.begin(), aPropStates.end(), lcl_validPropState ) ) { - GetAutoStylePool().Add( nFamily, sParent, aPropStates ); + GetAutoStylePool().Add( nFamily, sParent, std::vector(aPropStates) ); if( !sCondParent.isEmpty() && sParent != sCondParent ) - GetAutoStylePool().Add( nFamily, sCondParent, aPropStates ); + GetAutoStylePool().Add( nFamily, sCondParent, std::move(aPropStates) ); } } |