diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-11-24 13:37:54 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-11-24 21:55:09 +0100 |
commit | 796cbe6efcf0e7dcd9985bad0a8539a8952932f2 (patch) | |
tree | 95517b25679c3fb2f603cb88f6c331543a3c89af | |
parent | 487ed7fdd6ea9687336112afcd80e7e8d723b8fc (diff) |
Replace list by vector in unocoll.cxx (sw)
Same logic as https://gerrit.libreoffice.org/#/c/63928/
Change-Id: I59d5329687f94dcf0dba53a428f580313467829c
Reviewed-on: https://gerrit.libreoffice.org/63939
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | sw/source/core/unocore/unocoll.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 8bc20f1ed03d..d12bb74f5f8e 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -61,7 +61,6 @@ #include <unochart.hxx> #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> -#include <list> #include <iterator> #include <unosection.hxx> #include <unoparagraph.hxx> @@ -1057,8 +1056,7 @@ namespace : public SwSimpleEnumeration_Base { private: - typedef std::list< Any > frmcontainer_t; - frmcontainer_t m_aFrames; + std::vector< Any > m_aFrames; protected: virtual ~SwXFrameEnumeration() override {}; public: @@ -1085,10 +1083,8 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc) return; // #i104937# const size_t nSize = pFormats->size(); - std::insert_iterator<frmcontainer_t> pInserter = std::insert_iterator<frmcontainer_t>(m_aFrames, m_aFrames.begin()); // #i104937# SwFrameFormat* pFormat( nullptr ); - for( size_t i = 0; i < nSize; ++i ) { // #i104937# @@ -1100,7 +1096,7 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc) continue; const SwNode* pNd = pDoc->GetNodes()[ pIdx->GetIndex() + 1 ]; if(UnoFrameWrap_traits<T>::filter(pNd)) - *pInserter++ = lcl_UnoWrapFrame<T>(pFormat); + m_aFrames.push_back(lcl_UnoWrapFrame<T>(pFormat)); } } @@ -1117,8 +1113,9 @@ Any SwXFrameEnumeration<T>::nextElement() SolarMutexGuard aGuard; if(m_aFrames.empty()) throw NoSuchElementException(); - Any aResult = *m_aFrames.begin(); - m_aFrames.pop_front(); + + Any aResult = m_aFrames.back(); + m_aFrames.pop_back(); return aResult; } |