diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-10-17 23:01:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-18 08:43:43 +0200 |
commit | ebfdb9a15a2228ca85213d7d8e478f92953a54e2 (patch) | |
tree | c4fd79c38fd205661669e1339ed43c20d07ab5c6 /svl/source/undo | |
parent | 695c15ed6e8c4d0236970798f463c7488a903a38 (diff) |
Replace lists by vectors in svl
+ remove using namespace std and use prefix std::
Change-Id: Iab432f2c88ba5a15541bd97567682c6a34b0af2e
Reviewed-on: https://gerrit.libreoffice.org/43471
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/undo')
-rw-r--r-- | svl/source/undo/undo.cxx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index 087f65986568..7227fb1db638 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -31,7 +31,6 @@ #include <memory> #include <vector> -#include <list> #include <limits.h> #include <algorithm> @@ -367,8 +366,8 @@ namespace svl { namespace undo { namespace impl private: SfxUndoManager_Data& m_rManagerData; ::osl::ResettableMutexGuard m_aGuard; - ::std::list< SfxUndoAction* > m_aUndoActionsCleanup; - ::std::list< NotifyUndoListener > m_notifiers; + ::std::vector< SfxUndoAction* > m_aUndoActionsCleanup; + ::std::vector< NotifyUndoListener > m_notifiers; }; UndoManagerGuard::~UndoManagerGuard() @@ -380,21 +379,15 @@ namespace svl { namespace undo { namespace impl m_aGuard.clear(); // delete all actions - while ( !m_aUndoActionsCleanup.empty() ) - { - SfxUndoAction* pAction = m_aUndoActionsCleanup.front(); - m_aUndoActionsCleanup.pop_front(); - delete pAction; - } + for (auto const& undoAction : m_aUndoActionsCleanup) + delete undoAction; + m_aUndoActionsCleanup.clear(); // handle scheduled notification - for ( ::std::list< NotifyUndoListener >::const_iterator notifier = m_notifiers.begin(); - notifier != m_notifiers.end(); - ++notifier - ) + for (auto const& notifier : m_notifiers) { - if ( notifier->is() ) - ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(), *notifier ); + if ( notifier.is() ) + ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(), notifier ); } } } } } |