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

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sat May 11 08:55:39 UTC 2019


 filter/source/xsltfilter/LibXSLTTransformer.cxx |    4 ++--
 filter/source/xsltfilter/LibXSLTTransformer.hxx |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c77895fe6fd4f9f38ab00f29cb1e47e8544ebbec
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat May 11 08:28:05 2019 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat May 11 10:54:49 2019 +0200

    Replace list by deque in xsltfilter
    
    + replace remove by erase remove idiom
    + use push_front instead of using insert at beginning
    
    Change-Id: I3320a4e4cadeee05c7ca347987360c3c75fe6b3d
    Reviewed-on: https://gerrit.libreoffice.org/72139
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index acc81d4e1196..3be9e7351990 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -408,14 +408,14 @@ namespace XSLT
     void
     LibXSLTTransformer::addListener(const css::uno::Reference<XStreamListener>& listener)
     {
-        m_listeners.insert(m_listeners.begin(), listener);
+        m_listeners.push_front(listener);
     }
 
     void
     LibXSLTTransformer::removeListener(
             const css::uno::Reference<XStreamListener>& listener)
     {
-        m_listeners.remove(listener);
+        m_listeners.erase( std::remove(m_listeners.begin(), m_listeners.end(), listener ), m_listeners.end() );
     }
 
     void
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.hxx b/filter/source/xsltfilter/LibXSLTTransformer.hxx
index 7261978ed6ed..fb0b222ed29f 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.hxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.hxx
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_FILTER_SOURCE_XSLTFILTER_LIBXSLTTRANSFORMER_HXX
 #define INCLUDED_FILTER_SOURCE_XSLTFILTER_LIBXSLTTRANSFORMER_HXX
 
-#include <list>
+#include <deque>
 #include <map>
 #include <mutex>
 
@@ -109,7 +109,7 @@ namespace XSLT
 
         css::uno::Reference<XOutputStream> m_rOutputStream;
 
-        typedef ::std::list<css::uno::Reference<XStreamListener> > ListenerList;
+        typedef ::std::deque<css::uno::Reference<XStreamListener> > ListenerList;
 
         ListenerList m_listeners;
 


More information about the Libreoffice-commits mailing list