diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-09 12:38:04 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-09 12:51:43 -0400 |
commit | 019617d590c559dee2f4fdb3524725f9b70da9d2 (patch) | |
tree | ea0fcda60c3c1ad705db5eb95733189764584081 /package/source | |
parent | efd6106f098fb327aa84223883da413313f3d7e4 (diff) |
Use for_each with boost::checked_deletor for this.
Change-Id: Iea8ef5138bc98e50a196cb38051a199b326c1405
Diffstat (limited to 'package/source')
-rw-r--r-- | package/source/xstor/xstorage.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index e4e9174f8fe5..fc538b62fe9e 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -53,6 +53,8 @@ #include "switchpersistencestream.hxx" #include "ohierarchyholder.hxx" +#include <boost/checked_delete.hpp> + using namespace ::com::sun::star; #if OSL_DEBUG_LEVEL > 0 @@ -335,16 +337,10 @@ OStorage_Impl::~OStorage_Impl() m_pParent = NULL; } - for ( SotElementList_Impl::iterator pElementIter = m_aChildrenList.begin(); - pElementIter != m_aChildrenList.end(); ++pElementIter ) - delete *pElementIter; - + std::for_each(m_aChildrenList.begin(), m_aChildrenList.end(), boost::checked_deleter<SotElement_Impl>()); m_aChildrenList.clear(); - for ( SotElementList_Impl::iterator pDeletedIter = m_aDeletedList.begin(); - pDeletedIter != m_aDeletedList.end(); ++pDeletedIter ) - delete *pDeletedIter; - + std::for_each(m_aDeletedList.begin(), m_aDeletedList.end(), boost::checked_deleter<SotElement_Impl>()); m_aDeletedList.clear(); if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_pRelStorElement ) |