summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-10 19:59:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-10 21:03:18 +0200
commitf67392948d625db9ce115092e4c9bfd301268a25 (patch)
tree0bd1490ad019c3c172229e8990c62262c3f557fe /xmloff/source/style
parent210bbdead214531172d74d0d2975f47cf973bc69 (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/style')
-rw-r--r--xmloff/source/style/XMLPageExport.cxx6
-rw-r--r--xmloff/source/style/impastpl.cxx20
-rw-r--r--xmloff/source/style/impastpl.hxx10
-rw-r--r--xmloff/source/style/xmlaustp.cxx16
4 files changed, 26 insertions, 26 deletions
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,