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

Takeshi Abe tabe at fixedpoint.jp
Wed Oct 19 13:16:18 UTC 2016


 sw/source/core/access/accmap.cxx |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

New commits:
commit d24694fb1b273aeeba8717638d23d190953fb82f
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Oct 19 16:56:38 2016 +0900

    sw: Avoid inheritance from std::list
    
    Change-Id: Ifb45d20a1556db8d8ba01b65078b45df73bc8dcc
    Reviewed-on: https://gerrit.libreoffice.org/30037
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index f1b63ca..0aed777 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -498,8 +498,9 @@ public:
     }
 };
 
-class SwAccessibleEventList_Impl: public std::list < SwAccessibleEvent_Impl >
+class SwAccessibleEventList_Impl
 {
+    std::list<SwAccessibleEvent_Impl> maEvents;
     bool mbFiring;
 
 public:
@@ -517,6 +518,19 @@ public:
     }
 
     void MoveMissingXAccToEnd();
+
+    size_t size() const { return maEvents.size(); }
+    std::list<SwAccessibleEvent_Impl>::iterator begin() { return maEvents.begin(); }
+    std::list<SwAccessibleEvent_Impl>::iterator end() { return maEvents.end(); }
+    std::list<SwAccessibleEvent_Impl>::iterator insert( std::list<SwAccessibleEvent_Impl>::iterator aIter,
+                                                        const SwAccessibleEvent_Impl& rEvent )
+    {
+        return maEvents.insert( aIter, rEvent );
+    }
+    std::list<SwAccessibleEvent_Impl>::iterator erase( std::list<SwAccessibleEvent_Impl>::iterator aPos )
+    {
+        return maEvents.erase( aPos );
+    }
 };
 
 // see comment in SwAccessibleMap::InvalidatePosOrSize()
@@ -529,7 +543,7 @@ void SwAccessibleEventList_Impl::MoveMissingXAccToEnd()
         return;
     }
     SwAccessibleEventList_Impl lstEvent;
-    for (iterator li = begin(); li != end(); )
+    for (auto li = begin(); li != end(); )
     {
         if (li->IsNoXaccParentFrame())
         {
@@ -540,7 +554,7 @@ void SwAccessibleEventList_Impl::MoveMissingXAccToEnd()
             ++li;
     }
     OSL_ENSURE(size() + lstEvent.size() == nSize ,"");
-    insert(end(),lstEvent.begin(),lstEvent.end());
+    maEvents.insert(end(),lstEvent.begin(),lstEvent.end());
     OSL_ENSURE(size() == nSize ,"");
 }
 
@@ -567,7 +581,7 @@ class SwAccessibleEventMap_Impl
 {
 public:
     typedef SwAccessibleChild                                           key_type;
-    typedef SwAccessibleEventList_Impl::iterator                        mapped_type;
+    typedef std::list<SwAccessibleEvent_Impl>::iterator                 mapped_type;
     typedef std::pair<const key_type,mapped_type>                       value_type;
     typedef SwAccessibleChildFunc                                       key_compare;
     typedef std::map<key_type,mapped_type,key_compare>::iterator        iterator;


More information about the Libreoffice-commits mailing list