diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 08:54:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-11 09:44:12 +0200 |
commit | 3428bd5fa3626844355f20997ba690fd04297982 (patch) | |
tree | 683256f95828e54edecdd87fbde0ce32a634a834 /desktop | |
parent | 9c5c905680f7cb58eb3d0fbf25725a50c17896da (diff) |
clang-tidy modernize-use-emplace in d*
Change-Id: I79ac90faf24b4c741545e411dbaea7826c2df531
Reviewed-on: https://gerrit.libreoffice.org/42150
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
11 files changed, 20 insertions, 24 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index a269f9c639e4..237ec9fbf103 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -244,7 +244,7 @@ void DesktopLOKTest::callbackImpl(int nType, const char* pPayload) boost::property_tree::read_json(aStream, aTree); for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("searchResultSelection")) { - m_aSearchResultSelection.push_back(rValue.second.get<std::string>("rectangles").c_str()); + m_aSearchResultSelection.emplace_back(rValue.second.get<std::string>("rectangles").c_str()); m_aSearchResultPart.push_back(std::atoi(rValue.second.get<std::string>("part").c_str())); } } diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index c33dcaf61c8d..6cd75c0d5f4d 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -435,7 +435,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest // Use local vector to store dispatcher because we have to fill our request container before // we can dispatch. Otherwise it would be possible that statusChanged is called before we dispatched all requests!! - aDispatches.push_back( DispatchHolder( aURL, xDispatcher )); + aDispatches.emplace_back( aURL, xDispatcher ); } } else if ( aName.startsWith( "service:" ) ) diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 49f27bb49669..033fbf48bb77 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -908,7 +908,7 @@ void ExtensionBox_Impl::addEventListenerOnce( FindWeakRef(extension)) ) { extension->addEventListener( m_xRemoveListener.get() ); - m_vListenerAdded.push_back(extension); + m_vListenerAdded.emplace_back(extension); } } diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx index c433384da5e5..c1612139a828 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx @@ -389,7 +389,7 @@ void UpdateInstallDialog::Thread::downloadExtensions() } catch ( cssu::Exception & e ) { - vecExceptions.push_back( std::make_pair(seqDownloadURLs[j], e)); + vecExceptions.emplace_back(seqDownloadURLs[j], e); //There can be several different errors, for example, the URL is wrong, webserver cannot be reached, //name cannot be resolved. The UCB helper API does not specify different special exceptions for these //cases. Therefore ignore and continue. diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx index 879400546460..e31f4650ed24 100644 --- a/desktop/source/deployment/manager/dp_activepackages.cxx +++ b/desktop/source/deployment/manager/dp_activepackages.cxx @@ -170,19 +170,17 @@ ActivePackages::Entries ActivePackages::getEntries() const { i != m.end(); ++i) { if (!i->first.isEmpty() && i->first[0] == separator) { - es.push_back( - std::make_pair( + es.emplace_back( OUString( i->first.getStr() + 1, i->first.getLength() - 1, RTL_TEXTENCODING_UTF8), - decodeNewData(i->second))); + decodeNewData(i->second)); } else { OUString fn( OStringToOUString(i->first, RTL_TEXTENCODING_UTF8)); - es.push_back( - std::make_pair( + es.emplace_back( ::dp_misc::generateLegacyIdentifier(fn), - decodeOldData(fn, i->second))); + decodeOldData(fn, i->second)); } } #else diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 73117ac8ed82..31acc903fa85 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -169,9 +169,9 @@ ExtensionManager::ExtensionManager( Reference< uno::XComponentContext > const& x m_xPackageManagerFactory = css::deployment::thePackageManagerFactory::get(m_xContext); OSL_ASSERT(m_xPackageManagerFactory.is()); - m_repositoryNames.push_back("user"); - m_repositoryNames.push_back("shared"); - m_repositoryNames.push_back("bundled"); + m_repositoryNames.emplace_back("user"); + m_repositoryNames.emplace_back("shared"); + m_repositoryNames.emplace_back("bundled"); } ExtensionManager::~ExtensionManager() diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx index d74bfc5e3f3d..c962c228f756 100644 --- a/desktop/source/deployment/misc/dp_ucb.cxx +++ b/desktop/source/deployment/misc/dp_ucb.cxx @@ -290,7 +290,7 @@ bool readProperties( std::list< std::pair< OUString, OUString> > & out_result, { OUString name = aLine.copy(0, posEqual); OUString value = aLine.copy(posEqual + 1); - out_result.push_back(std::make_pair(name, value)); + out_result.emplace_back(name, value); } if (bEOF) diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx index 9bde54bcad39..b4c385c61cea 100644 --- a/desktop/source/deployment/misc/dp_update.cxx +++ b/desktop/source/deployment/misc/dp_update.cxx @@ -101,7 +101,7 @@ void getOwnUpdateInfos( Sequence<Reference< xml::dom::XElement > > infos(getUpdateInformation(updateInformation, urls, id, anyError)); if (anyError.hasValue()) - out_errors.push_back(std::make_pair(i->second.extension, anyError)); + out_errors.emplace_back(i->second.extension, anyError); for (sal_Int32 j = 0; j < infos.getLength(); ++j) { @@ -146,7 +146,7 @@ void getDefaultUpdateInfos( updateInformation, Sequence< OUString >(&sDefaultURL, 1), OUString(), anyError)); if (anyError.hasValue()) - out_errors.push_back(std::make_pair(Reference<deployment::XPackage>(), anyError)); + out_errors.emplace_back(Reference<deployment::XPackage>(), anyError); for (sal_Int32 i = 0; i < infos.getLength(); ++i) { Reference< xml::dom::XNode > node(infos[i], UNO_QUERY_THROW); diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 847fbf30fba9..4c5805b4b54a 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -1136,9 +1136,8 @@ void extractComponentData( css::uno::Reference< css::registry::XRegistryKey > > singletonKeys(singletons->openKeys()); for (sal_Int32 j = 0; j < singletonKeys.getLength(); ++j) { - data->singletons.push_back( - std::pair< OUString, OUString >( - singletonKeys[j]->getKeyName().copy(prefix2), name)); + data->singletons.emplace_back( + singletonKeys[j]->getKeyName().copy(prefix2), name); } } if (factories != nullptr) { diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index f44b1d7ac2f1..58f6e1137db5 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -368,8 +368,8 @@ BackendDb::readVectorOfPair( xpathApi->selectSingleNode(aPair, sExprSecond); OSL_ASSERT(first.is() && second.is()); - retVector.push_back(std::make_pair( - first->getNodeValue(), second->getNodeValue())); + retVector.emplace_back( + first->getNodeValue(), second->getNodeValue()); } return retVector; } diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index e5c061d021f9..d3d29d904dfc 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -861,9 +861,8 @@ void BackendImpl::PackageImpl::processPackage_( ::cppu::throwException(exc); } } - data.items.push_back( - std::make_pair(xPackage->getURL(), - xPackage->getPackageType()->getMediaType())); + data.items.emplace_back(xPackage->getURL(), + xPackage->getPackageType()->getMediaType()); } getMyBackend()->addDataToDb(getURL(), data); } |