[Libreoffice-commits] core.git: vcl/headless vcl/inc

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 15 19:17:09 UTC 2020


 vcl/headless/svpframe.cxx     |    6 +++---
 vcl/inc/headless/svpframe.hxx |    3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 98e9759a2513651683b7f372497d5007c7961727
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Oct 11 13:02:00 2020 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Thu Oct 15 21:16:24 2020 +0200

    Replace list by vector in vcl/svpframe
    
    Change-Id: I0980a46869f11998f1529c8b95d93e302cb2692c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104181
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 89af9b272185..7e5d00af208c 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -78,11 +78,11 @@ SvpSalFrame::~SvpSalFrame()
     if( m_pInstance )
         m_pInstance->deregisterFrame( this );
 
-    std::list<SvpSalFrame*> Children = m_aChildren;
+    std::vector<SvpSalFrame*> Children = m_aChildren;
     for( auto& rChild : Children )
         rChild->SetParent( m_pParent );
     if( m_pParent )
-        m_pParent->m_aChildren.remove( this );
+        m_pParent->m_aChildren.erase(std::remove(m_pParent->m_aChildren.begin(), m_pParent->m_aChildren.end(), this), m_pParent->m_aChildren.end());
 
     if( s_pFocusFrame == this )
     {
@@ -474,7 +474,7 @@ void SvpSalFrame::SimulateKeyPress( sal_uInt16 /*nKeyCode*/ )
 void SvpSalFrame::SetParent( SalFrame* pNewParent )
 {
     if( m_pParent )
-        m_pParent->m_aChildren.remove( this );
+        m_pParent->m_aChildren.erase(std::remove(m_pParent->m_aChildren.begin(), m_pParent->m_aChildren.end(), this), m_pParent->m_aChildren.end());
     m_pParent = static_cast<SvpSalFrame*>(pNewParent);
 }
 
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index 7245a31d5c8c..9faf8b8230f4 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -24,7 +24,6 @@
 
 #include <salframe.hxx>
 
-#include <list>
 #include <vector>
 
 #ifdef IOS
@@ -39,7 +38,7 @@ class SvpSalFrame : public SalFrame
 {
     SvpSalInstance*                     m_pInstance;
     SvpSalFrame*                        m_pParent;       // pointer to parent frame
-    std::list< SvpSalFrame* >           m_aChildren;     // List of child frames
+    std::vector< SvpSalFrame* >         m_aChildren;     // Vector of child frames
     SalFrameStyleFlags                  m_nStyle;
     bool                                m_bVisible;
 #ifndef IOS


More information about the Libreoffice-commits mailing list