[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 24 20:55:28 UTC 2018


 sw/source/core/unocore/unocoll.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 796cbe6efcf0e7dcd9985bad0a8539a8952932f2
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat Nov 24 13:37:54 2018 +0100
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Nov 24 21:55:09 2018 +0100

    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 at yahoo.fr>

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;
 }
 


More information about the Libreoffice-commits mailing list