diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-09-21 22:04:46 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-09-22 07:06:15 +0200 |
commit | a6b80833b0e8e2601fed7b9bc89ff79087edaf20 (patch) | |
tree | afbf8a1833347a79963ed298361f151decd135be /ucb/source/ucp | |
parent | 31919b8909fa7b34412dd52c3d4dff17bc5b6fab (diff) |
Replace some lists by vectors (ucb)
Change-Id: I2e42f6b0f3835400bca008cca31129fc03a76359
Reviewed-on: https://gerrit.libreoffice.org/42607
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'ucb/source/ucp')
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontent.cxx | 19 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontent.hxx | 6 |
2 files changed, 10 insertions, 15 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index e692597e3f01..76c0d94f1398 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -717,7 +717,7 @@ HierarchyContent::makeNewIdentifier( const OUString& rTitle ) } -void HierarchyContent::queryChildren( HierarchyContentRefList& rChildren ) +void HierarchyContent::queryChildren( HierarchyContentRefVector& rChildren ) { if ( ( m_eKind != FOLDER ) && ( m_eKind != ROOT ) ) return; @@ -808,13 +808,12 @@ bool HierarchyContent::exchangeIdentity( { // Process instantiated children... - HierarchyContentRefList aChildren; + HierarchyContentRefVector aChildren; queryChildren( aChildren ); - HierarchyContentRefList::const_iterator it = aChildren.begin(); - HierarchyContentRefList::const_iterator end = aChildren.end(); + HierarchyContentRefVector::const_iterator it = aChildren.begin(); - while ( it != end ) + while ( it != aChildren.end() ) { HierarchyContentRef xChild = (*it); @@ -1488,16 +1487,12 @@ void HierarchyContent::destroy( bool bDeletePhysical, { // Process instantiated children... - HierarchyContentRefList aChildren; + HierarchyContentRefVector aChildren; queryChildren( aChildren ); - HierarchyContentRefList::const_iterator it = aChildren.begin(); - HierarchyContentRefList::const_iterator end = aChildren.end(); - - while ( it != end ) + for ( auto & child : aChildren) { - (*it)->destroy( bDeletePhysical, xEnv ); - ++it; + child->destroy( bDeletePhysical, xEnv ); } } } diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.hxx b/ucb/source/ucp/hierarchy/hierarchycontent.hxx index 60b19b2aa71c..cff4a2832345 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.hxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYCONTENT_HXX #define INCLUDED_UCB_SOURCE_UCP_HIERARCHY_HIERARCHYCONTENT_HXX -#include <list> +#include <vector> #include <rtl/ref.hxx> #include <com/sun/star/ucb/XContentCreator.hpp> #include <ucbhelper/contenthelper.hxx> @@ -155,8 +155,8 @@ private: makeNewIdentifier( const OUString& rTitle ); typedef rtl::Reference< HierarchyContent > HierarchyContentRef; - typedef std::list< HierarchyContentRef > HierarchyContentRefList; - void queryChildren( HierarchyContentRefList& rChildren ); + typedef std::vector< HierarchyContentRef > HierarchyContentRefVector; + void queryChildren( HierarchyContentRefVector& rChildren ); bool exchangeIdentity( const css::uno::Reference< css::ucb::XContentIdentifier >& xNewId ); |