summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-11 16:43:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-12 08:03:09 +0200
commit65e293f524437a548b6c099bbe6099b56957063c (patch)
treef058b4f61a6f046e71c45814e1a8c0fb749162a9
parentbaa5f32c21185025b64c01fc589c69961528b0c5 (diff)
clang-tidy modernize-use-emplace in package..sax
Change-Id: Ibc0258fd79df987a0e295552bcc5bf89ee12007a Reviewed-on: https://gerrit.libreoffice.org/42173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--package/source/manifest/ManifestImport.cxx4
-rw-r--r--package/source/xstor/ohierarchyholder.cxx2
-rw-r--r--package/source/xstor/xstorage.cxx4
-rw-r--r--postprocess/qa/services.cxx14
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx18
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx2
-rw-r--r--reportdesign/source/ui/misc/RptUndo.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx2
-rw-r--r--sax/qa/cppunit/xmlimport.cxx4
-rw-r--r--sax/source/tools/fastattribs.cxx4
-rw-r--r--sax/source/tools/fshelper.cxx4
11 files changed, 29 insertions, 31 deletions
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index bfde6aa3cb2c..3868be460c41 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -351,7 +351,7 @@ OUString ManifestImport::PushNameAndNamespaces( const OUString& aName, const uno
aNamespaces[aNsName] = aAttrValue;
} else {
// this is no namespace declaration
- aAttribsStrs.push_back( pair< OUString, OUString >( aAttrName, aAttrValue ) );
+ aAttribsStrs.emplace_back( aAttrName, aAttrValue );
}
}
}
@@ -360,7 +360,7 @@ OUString ManifestImport::PushNameAndNamespaces( const OUString& aName, const uno
if ( !aConvertedName.getLength() )
aConvertedName = ConvertName( aName );
- aStack.push_back( ManifestScopeEntry( aConvertedName, aNamespaces ) );
+ aStack.emplace_back( aConvertedName, aNamespaces );
for (const std::pair<OUString,OUString> & rAttribsStr : aAttribsStrs) {
// convert the attribute names on filling
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index 96a079e5ccd5..c07c7740c502 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -123,7 +123,7 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStrea
xStreamComp->addEventListener( static_cast< lang::XEventListener* >( this ) );
}
- m_aOpenStreams.push_back( uno::WeakReference< embed::XExtendedStorageStream >( xResult ) );
+ m_aOpenStreams.emplace_back( xResult );
}
else
{
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 79b239588c77..06c5ec31ae4e 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -375,7 +375,7 @@ void OStorage_Impl::SetReadOnlyWrap( OStorage& aStorage )
{
// Weak reference is used inside the holder so the refcount must not be zero at this point
OSL_ENSURE( aStorage.GetRefCount_Impl(), "There must be a reference alive to use this method!" );
- m_aReadOnlyWrapVector.push_back( StorageHolder_Impl( &aStorage ) );
+ m_aReadOnlyWrapVector.emplace_back( &aStorage );
}
void OStorage_Impl::RemoveReadOnlyWrap( OStorage& aStorage )
@@ -2042,7 +2042,7 @@ void OStorage::MakeLinkToSubComponent_Impl( const uno::Reference< lang::XCompone
xComponent->addEventListener( uno::Reference< lang::XEventListener >(
static_cast< ::cppu::OWeakObject* >(m_pData->m_pSubElDispListener.get()), uno::UNO_QUERY));
- m_pData->m_aOpenSubComponentsVector.push_back( xComponent );
+ m_pData->m_aOpenSubComponentsVector.emplace_back(xComponent );
}
// XInterface
diff --git a/postprocess/qa/services.cxx b/postprocess/qa/services.cxx
index 9616a4a1dc44..0ab677339d9d 100644
--- a/postprocess/qa/services.cxx
+++ b/postprocess/qa/services.cxx
@@ -126,11 +126,11 @@ void Test::test() {
// ImplBorderWindow::ImplInit -> Window::ImplInit ->
// WinSalInstance::CreateFrame -> ImplSendMessage -> SendMessageW):
std::vector<OUString> blacklist;
- blacklist.push_back("com.sun.star.comp.report.OReportDefinition");
+ blacklist.emplace_back("com.sun.star.comp.report.OReportDefinition");
// <https://bugs.documentfoundation.org/show_bug.cgi?id=89343>
// "~SwXMailMerge() goes into endless SwCache::Check()":
- blacklist.push_back("SwXMailMerge");
+ blacklist.emplace_back("SwXMailMerge");
css::uno::Reference<css::container::XContentEnumerationAccess> enumAcc(
m_xContext->getServiceManager(), css::uno::UNO_QUERY_THROW);
@@ -168,9 +168,8 @@ void Test::test() {
css::uno::UNO_SET_THROW);
std::vector<css::uno::Reference<css::lang::XServiceInfo>> serviceImpls2;
while (serviceImpls1->hasMoreElements()) {
- serviceImpls2.push_back(
- css::uno::Reference<css::lang::XServiceInfo>(
- serviceImpls1->nextElement(), css::uno::UNO_QUERY_THROW));
+ serviceImpls2.emplace_back(
+ serviceImpls1->nextElement(), css::uno::UNO_QUERY_THROW);
}
css::uno::Reference<css::reflection::XServiceTypeDescription2> desc;
if (typeMgr->hasByHierarchicalName(serviceNames[i])) {
@@ -234,10 +233,9 @@ void Test::test() {
ctors(desc->getConstructors());
for (sal_Int32 l = 0; l != ctors.getLength(); ++l) {
if (!ctors[l]->getParameters().hasElements()) {
- k->second.constructors.push_back(
- Constructor(
+ k->second.constructors.emplace_back(
serviceNames[i],
- ctors[l]->isDefaultConstructor()));
+ ctors[l]->isDefaultConstructor());
break;
}
}
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index f7345aa0118f..a08b4cce1779 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -498,7 +498,7 @@ void lcl_calculate(const ::std::vector<sal_Int32>& _aPosX,const ::std::vector<sa
void ORptExport::collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, ORptExport::TStringVec& _rStyleNames)
{
::std::vector< XMLPropertyState > aPropertyStates;
- aPropertyStates.push_back(XMLPropertyState(0));
+ aPropertyStates.emplace_back(0);
::std::vector<sal_Int32>::const_iterator aIter = _aSize.begin();
::std::vector<sal_Int32>::const_iterator aIter2 = aIter + 1;
::std::vector<sal_Int32>::const_iterator aEnd = _aSize.end();
@@ -1155,15 +1155,15 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted
if ( !aPos.X )
{
sBorderProp = PROPERTY_BORDERLEFT;
- aProps.push_back(PROPERTY_BORDERRIGHT);
+ aProps.emplace_back(PROPERTY_BORDERRIGHT);
}
else
{
sBorderProp = PROPERTY_BORDERRIGHT;
- aProps.push_back(PROPERTY_BORDERLEFT);
+ aProps.emplace_back(PROPERTY_BORDERLEFT);
}
- aProps.push_back(PROPERTY_BORDERTOP);
- aProps.push_back(PROPERTY_BORDERBOTTOM);
+ aProps.emplace_back(PROPERTY_BORDERTOP);
+ aProps.emplace_back(PROPERTY_BORDERBOTTOM);
}
else // horizontal
{
@@ -1171,15 +1171,15 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted
if ( (aPos.Y + aSize.Height) == nSectionHeight )
{
sBorderProp = PROPERTY_BORDERBOTTOM;
- aProps.push_back(PROPERTY_BORDERTOP);
+ aProps.emplace_back(PROPERTY_BORDERTOP);
}
else
{
sBorderProp = PROPERTY_BORDERTOP;
- aProps.push_back(PROPERTY_BORDERBOTTOM);
+ aProps.emplace_back(PROPERTY_BORDERBOTTOM);
}
- aProps.push_back(PROPERTY_BORDERRIGHT);
- aProps.push_back(PROPERTY_BORDERLEFT);
+ aProps.emplace_back(PROPERTY_BORDERRIGHT);
+ aProps.emplace_back(PROPERTY_BORDERLEFT);
}
xBorderProp->setPropertyValue(sBorderProp,uno::makeAny(aValue));
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 77f2eaa8ba12..3ffff9305280 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -68,7 +68,7 @@ using namespace ::comphelper;
OUString sLabel;
if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) )
xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
- o_aColumnList.push_back( ColumnInfo(*pEntries,sLabel) );
+ o_aColumnList.emplace_back(*pEntries,sLabel );
if ( !sLabel.isEmpty() )
_rListBox.InsertEntry( sLabel );
else
diff --git a/reportdesign/source/ui/misc/RptUndo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx
index dec9f097b337..2c5b9697997e 100644
--- a/reportdesign/source/ui/misc/RptUndo.cxx
+++ b/reportdesign/source/ui/misc/RptUndo.cxx
@@ -163,7 +163,7 @@ void OSectionUndo::collectControls(const uno::Reference< report::XSection >& _xS
for(;pIter != pEnd;++pIter)
{
if ( 0 == (pIter->Attributes & beans::PropertyAttribute::READONLY) )
- m_aValues.push_back(::std::pair< OUString ,uno::Any>(pIter->Name,_xSection->getPropertyValue(pIter->Name)));
+ m_aValues.emplace_back(pIter->Name,_xSection->getPropertyValue(pIter->Name));
}
lcl_collectElements(_xSection,m_aControls);
}
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index feeb8eb09903..81eab1451313 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -359,7 +359,7 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedOb
try
{
SdrObject* pNewObj = pSdrObject->Clone();
- aCopies.push_back(uno::Reference<report::XReportComponent>(pNewObj->getUnoShape(),uno::UNO_QUERY));
+ aCopies.emplace_back(pNewObj->getUnoShape(),uno::UNO_QUERY);
if ( _bEraseAnddNoClone )
{
m_pView->AddUndo( rUndo.CreateUndoDeleteObject( *pSdrObject ) );
diff --git a/sax/qa/cppunit/xmlimport.cxx b/sax/qa/cppunit/xmlimport.cxx
index 543de556b8e8..efaab5fabbc6 100644
--- a/sax/qa/cppunit/xmlimport.cxx
+++ b/sax/qa/cppunit/xmlimport.cxx
@@ -105,9 +105,9 @@ OUString TestDocumentHandler::canonicalform(const OUString &sName, const OUStrin
{
m_aCountStack.top() += 1;
if ( nIndex < 0 )
- m_aNamespaceStack.push_back( make_pair( OUString( "default" ), sValue ) );
+ m_aNamespaceStack.emplace_back( OUString( "default" ), sValue );
else
- m_aNamespaceStack.push_back( make_pair( sName.copy( nIndex + 1 ), sValue ) );
+ m_aNamespaceStack.emplace_back( sName.copy( nIndex + 1 ), sValue );
}
else
{
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 314f156e8dfe..2416a3bb42c7 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -110,12 +110,12 @@ void FastAttributeList::addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, cons
void FastAttributeList::addUnknown( const OUString& rNamespaceURL, const OString& rName, const OString& value )
{
- maUnknownAttributes.push_back( UnknownAttribute( rNamespaceURL, rName, value ) );
+ maUnknownAttributes.emplace_back( rNamespaceURL, rName, value );
}
void FastAttributeList::addUnknown( const OString& rName, const OString& value )
{
- maUnknownAttributes.push_back( UnknownAttribute( rName, value ) );
+ maUnknownAttributes.emplace_back( rName, value );
}
// XFastAttributeList
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx
index 1229a8689c29..3875f54df6ca 100644
--- a/sax/source/tools/fshelper.cxx
+++ b/sax/source/tools/fshelper.cxx
@@ -46,11 +46,11 @@ void FastSerializerHelper::startElement(sal_Int32 elementTokenId, FSEND_t)
}
void FastSerializerHelper::pushAttributeValue(sal_Int32 attribute, const char* value)
{
- mpSerializer->getTokenValueList().push_back(TokenValue(attribute, value));
+ mpSerializer->getTokenValueList().emplace_back(attribute, value);
}
void FastSerializerHelper::pushAttributeValue(sal_Int32 attribute, const OString& value)
{
- mpSerializer->getTokenValueList().push_back(TokenValue(attribute, value.getStr()));
+ mpSerializer->getTokenValueList().emplace_back(attribute, value.getStr());
}
void FastSerializerHelper::singleElement(sal_Int32 elementTokenId, FSEND_t)
{