diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-13 16:43:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-14 08:29:11 +0200 |
commit | 2d2259c848b43f9f04d5bb6073c00b8ae124534a (patch) | |
tree | 28a3d6274bcb2ffa5b7c55c519fc07b4f2cfacc3 /ucb/source | |
parent | b0b0aef18fff981fa1f4a1539c150260cc526595 (diff) |
clang-tidy modernize-use-emplace in test..vbahelper
Change-Id: Ifbe1dd7c9d5dde33f7419548670434591b1a1d82
Reviewed-on: https://gerrit.libreoffice.org/42258
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/file/filrset.cxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/gio/gio_content.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontent.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/package/pkgcontent.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_content.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/ContentProperties.cxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx | 8 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 20 |
8 files changed, 25 insertions, 38 deletions
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index ff49703198a5..653ba85777c3 100644 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx @@ -239,8 +239,7 @@ XResultSet_impl::OneMore() { osl::MutexGuard aGuard( m_aMutex ); m_aItems.push_back( aRow ); - m_aIdents.push_back( - uno::Reference< ucb::XContentIdentifier >() ); + m_aIdents.emplace_back( ); m_aUnqPath.push_back( aUnqPath ); rowCountChanged(); return true; @@ -254,8 +253,7 @@ XResultSet_impl::OneMore() { osl::MutexGuard aGuard( m_aMutex ); m_aItems.push_back( aRow ); - m_aIdents.push_back( - uno::Reference< ucb::XContentIdentifier >() ); + m_aIdents.emplace_back( ); m_aUnqPath.push_back( aUnqPath ); rowCountChanged(); return true; @@ -268,8 +266,7 @@ XResultSet_impl::OneMore() { osl::MutexGuard aGuard( m_aMutex ); m_aItems.push_back( aRow ); - m_aIdents.push_back( - uno::Reference< ucb::XContentIdentifier >() ); + m_aIdents.emplace_back( ); m_aUnqPath.push_back( aUnqPath ); rowCountChanged(); return true; diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index f3f04ae5f4ec..f784fabe6411 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -586,7 +586,7 @@ void Content::queryChildren( ContentRefList& rChildren ) if ( ( nPos == -1 ) || ( nPos == ( aChildURL.getLength() - 1 ) ) ) { // No further slashes / only a final slash. It's a child! - rChildren.push_back( ::gio::Content::ContentRef (static_cast< ::gio::Content * >(xChild.get() ) ) ); + rChildren.emplace_back(static_cast< ::gio::Content * >(xChild.get() ) ); } } ++it; diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index f6b02647e732..e692597e3f01 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -760,9 +760,8 @@ void HierarchyContent::queryChildren( HierarchyContentRefList& rChildren ) ( nPos == ( aChildURL.getLength() - 1 ) ) ) { // No further slashes/ only a final slash. It's a child! - rChildren.push_back( - HierarchyContentRef( - static_cast< HierarchyContent * >( xChild.get() ) ) ); + rChildren.emplace_back( + static_cast< HierarchyContent * >( xChild.get() ) ); } } ++it; diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index b49a398357c8..c5269cc7e5a3 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -2070,9 +2070,8 @@ void Content::queryChildren( ContentRefList& rChildren ) if ( aChildURL.indexOf( '/', nLen ) == -1 ) { // No further slashes. It's a child! - rChildren.push_back( - ContentRef( - static_cast< Content * >( xChild.get() ) ) ); + rChildren.emplace_back( + static_cast< Content * >( xChild.get() ) ); } } ++it; diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 4d9df9b27b85..0b2437257dd4 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -743,9 +743,8 @@ void Content::queryChildren( ContentRefList& rChildren ) ( nPos == ( aChildURL.getLength() - 1 ) ) ) { // No further slashes / only a final slash. It's a child! - rChildren.push_back( - ContentRef( - static_cast< Content * >( xChild.get() ) ) ); + rChildren.emplace_back( + static_cast< Content * >( xChild.get() ) ); } } ++it; diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index a010a85623c3..de5b76226274 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -315,18 +315,15 @@ void ContentProperties::UCBNamesToHTTPNames( if ( rProp.Name == "DateModified" ) { - propertyNames.push_back( - OUString("Last-Modified") ); + propertyNames.emplace_back("Last-Modified" ); } else if ( rProp.Name == "MediaType" ) { - propertyNames.push_back( - OUString("Content-Type") ); + propertyNames.emplace_back("Content-Type" ); } else if ( rProp.Name == "Size" ) { - propertyNames.push_back( - OUString("Content-Length") ); + propertyNames.emplace_back("Content-Length" ); } else { diff --git a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx index 7252f77c0925..13def123748d 100644 --- a/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav-neon/DAVResourceAccess.cxx @@ -1089,10 +1089,9 @@ void DAVResourceAccess::getUserRequestHeaders( for ( sal_Int32 n = 0; n < aRequestHeaders.getLength(); ++n ) { - rRequestHeaders.push_back( - DAVRequestHeader( + rRequestHeaders.emplace_back( aRequestHeaders[ n ].First, - aRequestHeaders[ n ].Second ) ); + aRequestHeaders[ n ].Second ); } } } @@ -1109,8 +1108,7 @@ void DAVResourceAccess::getUserRequestHeaders( return; } } - rRequestHeaders.push_back( - DAVRequestHeader( "User-Agent", "LibreOffice" ) ); + rRequestHeaders.emplace_back( "User-Agent", "LibreOffice" ); } // This function member implements the control on cyclical redirections diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 7ac4add5c30b..cc381283dd98 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -110,8 +110,8 @@ namespace bool bIsRequestSize = false; DAVResource aResource; DAVRequestHeaders aPartialGet; - aPartialGet.push_back( DAVRequestHeader( OUString( "Range" ), // see <https://tools.ietf.org/html/rfc7233#section-3.1> - OUString( "bytes=0-0" ) ) ); + aPartialGet.emplace_back( OUString( "Range" ), // see <https://tools.ietf.org/html/rfc7233#section-3.1> + OUString( "bytes=0-0" ) ); for ( std::vector< rtl::OUString >::const_iterator it = aHeaderNames.begin(); it != aHeaderNames.end(); ++it ) @@ -127,8 +127,8 @@ namespace { // we need to know if the server accepts range requests for a resource // and the range unit it uses - aHeaderNames.push_back( OUString( "Accept-Ranges" ) ); // see <https://tools.ietf.org/html/rfc7233#section-2.3> - aHeaderNames.push_back( OUString( "Content-Range" ) ); // see <https://tools.ietf.org/html/rfc7233#section-4.2> + aHeaderNames.emplace_back( "Accept-Ranges" ); // see <https://tools.ietf.org/html/rfc7233#section-2.3> + aHeaderNames.emplace_back( "Content-Range" ); // see <https://tools.ietf.org/html/rfc7233#section-4.2> } try { @@ -1522,7 +1522,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // in case of not DAV PROFIND (previously in program flow) failed // so we need to add the only prop that's common // to DAV and NON_DAV: MediaType, that maps to Content-Type - aHeaderNames.push_back( "Content-Type" ); + aHeaderNames.emplace_back("Content-Type" ); } if (!aHeaderNames.empty()) try @@ -2479,10 +2479,9 @@ void Content::queryChildren( ContentRefList& rChildren ) ( nPos == ( aChildURL.getLength() - 1 ) ) ) { // No further slashes / only a final slash. It's a child! - rChildren.push_back( - ::webdav_ucp::Content::ContentRef( + rChildren.emplace_back( static_cast< ::webdav_ucp::Content * >( - xChild.get() ) ) ); + xChild.get() ) ); } } ++it; @@ -4277,10 +4276,9 @@ bool Content::isResourceAvailable( const css::uno::Reference< css::ucb::XCommand // do a GET with a payload of 0, the server does not // support HEAD (or has HEAD disabled) DAVRequestHeaders aPartialGet; - aPartialGet.push_back( - DAVRequestHeader( + aPartialGet.emplace_back( OUString( "Range" ), - OUString( "bytes=0-0" ))); + OUString( "bytes=0-0" )); rResAccess->GET0( aPartialGet, aHeaderNames, |