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

Stephan Bergmann sbergman at redhat.com
Mon Oct 20 04:43:05 PDT 2014


 configmgr/source/access.hxx     |    8 ++++----
 configmgr/source/components.hxx |    5 +++--
 configmgr/source/config_map.hxx |    3 +++
 configmgr/source/data.hxx       |    2 +-
 configmgr/source/nodemap.hxx    |    3 +--
 5 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 9df18fd92c0eb3153576f60b4b95a8cf96469eef
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Oct 20 13:38:12 2014 +0200

    Revert "fdo#75757: remove inheritance to std::map"
    
    This reverts commit a2deca9d755710bd543fd0caaea0352ac746396d: config_map had
    been introduced on purpose with bfb978334cea775b8ae5c40ceea050ea0660d80a
    "configmgr: faster / simpler compare for keys."
    
    Change-Id: I3ae0edc4d23977c6537bd2f462f90a702266de6d

diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index d8db2a8..807f2a2 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -487,7 +487,7 @@ private:
             bool theDirectlyModified);
     };
 
-    typedef std::map< OUString, ModifiedChild, LengthContentsCompare > ModifiedChildren;
+    typedef config_map< ModifiedChild > ModifiedChildren;
 
     rtl::Reference< ChildAccess > getModifiedChild(
         ModifiedChildren::iterator const & childIterator);
@@ -516,7 +516,7 @@ private:
 
     rtl::Reference< Access > getNotificationRoot();
 
-    typedef std::map< OUString, ChildAccess *, LengthContentsCompare > WeakChildMap;
+    typedef config_map< ChildAccess * > WeakChildMap;
 
     typedef
         std::multiset<
@@ -536,7 +536,7 @@ private:
                 com::sun::star::beans::XPropertyChangeListener > >
         PropertyChangeListenersElement;
 
-    typedef std::map< OUString, PropertyChangeListenersElement, LengthContentsCompare >
+    typedef config_map< PropertyChangeListenersElement >
         PropertyChangeListeners;
 
     typedef
@@ -545,7 +545,7 @@ private:
                 com::sun::star::beans::XVetoableChangeListener > >
         VetoableChangeListenersElement;
 
-    typedef std::map< OUString, VetoableChangeListenersElement, LengthContentsCompare >
+    typedef config_map< VetoableChangeListenersElement >
         VetoableChangeListeners;
 
     typedef
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index abd40b8..48c1f7a 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -148,8 +148,9 @@ private:
     typedef std::set< RootAccess * > WeakRootSet;
 
     typedef
-        std::map< OUString, com::sun::star::uno::Reference<
-                com::sun::star::beans::XPropertySet >, LengthContentsCompare >
+        config_map<
+            com::sun::star::uno::Reference<
+                com::sun::star::beans::XPropertySet > >
         ExternalServices;
 
     class WriteThread;
diff --git a/configmgr/source/config_map.hxx b/configmgr/source/config_map.hxx
index 943d409..0e9f614 100644
--- a/configmgr/source/config_map.hxx
+++ b/configmgr/source/config_map.hxx
@@ -9,6 +9,7 @@
 #ifndef CONFIG_MAP_HXX
 #define CONFIG_MAP_HXX
 
+#include <map>
 #include <rtl/ustring.hxx>
 
 // The realisation here is that while a map is a reasonably compact
@@ -27,6 +28,8 @@ struct LengthContentsCompare
     }
 };
 
+template< class T > struct config_map : public std::map< OUString, T, LengthContentsCompare > { };
+
 #endif // CONFIG_MAP_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
index 3dd8d08..17a0e1d 100644
--- a/configmgr/source/data.hxx
+++ b/configmgr/source/data.hxx
@@ -86,7 +86,7 @@ struct Data: private boost::noncopyable {
         OUString const & url);
 
 private:
-    typedef std::map< OUString, rtl::Reference< ExtensionXcu >, LengthContentsCompare >
+    typedef config_map< rtl::Reference< ExtensionXcu > >
         ExtensionXcuAdditions;
 
     rtl::Reference< Node > root_;
diff --git a/configmgr/source/nodemap.hxx b/configmgr/source/nodemap.hxx
index 1c01aa3..a000b30 100644
--- a/configmgr/source/nodemap.hxx
+++ b/configmgr/source/nodemap.hxx
@@ -21,14 +21,13 @@
 #define INCLUDED_CONFIGMGR_SOURCE_NODEMAP_HXX
 
 #include <sal/config.h>
-#include <map>
 #include "config_map.hxx"
 #include <rtl/ref.hxx>
 #include <node.hxx>
 
 namespace configmgr {
 
-typedef std::map< OUString, rtl::Reference< Node >, LengthContentsCompare > NodeMapImpl;
+typedef config_map< rtl::Reference< Node > > NodeMapImpl;
 class NodeMap
 {
     NodeMapImpl maImpl;


More information about the Libreoffice-commits mailing list