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

Herbert Dürr hdu at apache.org
Wed May 15 04:49:21 PDT 2013


 configmgr/source/partial.cxx |    2 +-
 configmgr/source/partial.hxx |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 8d9998f53af1806b06cf659f52607b2ac409a113
Author: Herbert Dürr <hdu at apache.org>
Date:   Wed May 15 08:24:08 2013 +0000

    Related: #i122208# avoid default assignment of recursive STL containers
    
    support for recursive STL containers is not required by the standard.
    Boost TR1 containers allow them explicitly though but for some compiler/stl
    combinations there are constness issues that prevent the default
    assignment operator to work. Adding a small helper function solves
    this problem in a clean way.
    (cherry picked from commit 58d204292c12eb5237106d223251d8855aca3ca2)
    
    Conflicts:
    	configmgr/source/partial.hxx
    
    Change-Id: I301765e47db12f3b158d4525e896e090f4b81bbb

diff --git a/configmgr/source/partial.cxx b/configmgr/source/partial.cxx
index d2ffa21..77e77e3 100644
--- a/configmgr/source/partial.cxx
+++ b/configmgr/source/partial.cxx
@@ -97,7 +97,7 @@ Partial::Partial(
             OUString seg;
             bool end = parseSegment(*i, &n, &seg);
             if (end) {
-                p->children[seg] = Node();
+                p->children[seg].clear();
                 break;
             }
             Node::Children::iterator j(p->children.find(seg));
diff --git a/configmgr/source/partial.hxx b/configmgr/source/partial.hxx
index ac78e0f..dd64a39 100644
--- a/configmgr/source/partial.hxx
+++ b/configmgr/source/partial.hxx
@@ -22,13 +22,13 @@
 
 #include "sal/config.h"
 
-#include <map>
+#include <boost/unordered_map.hpp> // using the boost container because it explicitly allows recursive types
 #include <set>
 
 #include "boost/noncopyable.hpp"
 
 #include "path.hxx"
-
+#include "rtl/ustring.hxx"
 
 namespace configmgr {
 
@@ -46,9 +46,10 @@ public:
 
 private:
     struct Node {
-        typedef std::map< OUString, Node > Children;
+        typedef boost::unordered_map< OUString, Node, OUStringHash > Children;
 
         Node(): startInclude(false) {}
+        void clear() { startInclude=false; children.clear(); }
 
         Children children;
         bool startInclude;


More information about the Libreoffice-commits mailing list