[Libreoffice-commits] core.git: basctl/source basic/source chart2/source comphelper/source compilerplugins/clang connectivity/source filter/source include/com include/comphelper include/oox include/rtl include/svx io/source oox/source reportdesign/source scripting/source stoc/source svx/source xmloff/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 30 06:44:13 UTC 2019


 basctl/source/basicide/documentenumeration.cxx          |    4 -
 basic/source/basmgr/basicmanagerrepository.cxx          |    3 
 chart2/source/view/charttypes/BarChart.cxx              |   23 ------
 comphelper/source/container/embeddedobjectcontainer.cxx |    7 --
 compilerplugins/clang/refcounting.cxx                   |    2 
 connectivity/source/cpool/ZPoolCollection.hxx           |    5 -
 filter/source/svg/svgfilter.hxx                         |   22 ++----
 include/com/sun/star/uno/Reference.hxx                  |   20 ++++++
 include/comphelper/accessiblewrapper.hxx                |    2 
 include/comphelper/stl_types.hxx                        |   15 ----
 include/oox/export/shapes.hxx                           |   14 ----
 include/rtl/ref.hxx                                     |   24 +++++++
 include/svx/fmtools.hxx                                 |    5 -
 io/source/acceptor/acc_socket.cxx                       |   23 ------
 io/source/connector/connector.hxx                       |   23 ------
 oox/source/export/shapes.cxx                            |    5 -
 reportdesign/source/core/sdr/UndoEnv.cxx                |    3 
 scripting/source/provider/ActiveMSPList.hxx             |    3 
 stoc/source/servicemanager/servicemanager.cxx           |   22 ------
 svx/source/form/fmpgeimp.cxx                            |    2 
 svx/source/form/navigatortree.cxx                       |    3 
 svx/source/inc/fmcontrolbordermanager.hxx               |    4 -
 svx/source/inc/fmvwimp.hxx                              |   10 ---
 svx/source/table/accessibletableshape.cxx               |   10 ---
 xmloff/source/forms/eventimport.hxx                     |    4 -
 xmloff/source/forms/ifacecompare.hxx                    |   53 ----------------
 xmloff/source/forms/layerexport.hxx                     |    7 --
 xmloff/source/forms/layerimport.hxx                     |    3 
 28 files changed, 73 insertions(+), 248 deletions(-)

New commits:
commit 22f2cf3ccc6d0c9ba2c2860735e789d6b3a25f72
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Apr 29 16:24:12 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 30 08:43:04 2019 +0200

    implement std::hash for css::uno::Reference and rtl::Reference
    
    The declaration in BarChart.cxx is particularly suspicious, because it
    was using a < for the KeyEqual template parameter.
    Been there since:
        commit b2c3233e5f267b5d244d722a94424a3b224b3314
        Date:   Thu Dec 21 20:08:33 2017 +0900
        chart2: suspend/resume setting rects dirty for 3D shapes
    
    comphelper::OInterfaceCompare is no longer necessary
    
    Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975
    Reviewed-on: https://gerrit.libreoffice.org/71537
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basctl/source/basicide/documentenumeration.cxx b/basctl/source/basicide/documentenumeration.cxx
index fd1517d097f9..9d00474efa00 100644
--- a/basctl/source/basicide/documentenumeration.cxx
+++ b/basctl/source/basicide/documentenumeration.cxx
@@ -29,8 +29,6 @@
 
 #include <tools/diagnose_ex.h>
 
-#include <comphelper/stl_types.hxx>
-
 namespace basctl { namespace docs {
 
     using ::com::sun::star::uno::Exception;
@@ -105,7 +103,7 @@ namespace basctl { namespace docs {
             const IDocumentDescriptorFilter* _pFilter )
         {
             // ensure we don't encounter some models multiple times
-            std::set< Reference< XModel >, ::comphelper::OInterfaceCompare< XModel > > aEncounteredModels;
+            std::set< Reference< XModel > > aEncounteredModels;
 
             for ( auto const & rFrame : _rFrames )
             {
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index 5b8b10f56d31..b725f0563a3c 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -35,7 +35,6 @@
 #include <tools/debug.hxx>
 #include <tools/diagnose_ex.h>
 #include <tools/urlobj.hxx>
-#include <comphelper/stl_types.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/documentinfo.hxx>
 #include <unotools/eventlisteneradapter.hxx>
@@ -62,7 +61,7 @@ namespace basic
     using ::com::sun::star::document::XStorageBasedDocument;
     using ::com::sun::star::document::XEmbeddedScripts;
 
-    typedef std::map< Reference< XInterface >, std::unique_ptr<BasicManager>, ::comphelper::OInterfaceCompare< XInterface > > BasicManagerStore;
+    typedef std::map< Reference< XInterface >, std::unique_ptr<BasicManager> > BasicManagerStore;
 
     typedef std::vector< BasicManagerCreationListener* >  CreationListeners;
 
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index b3d27a933d7a..bb1c50387d2e 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -45,27 +45,6 @@ using namespace ::com::sun::star;
 using namespace ::rtl::math;
 using namespace ::com::sun::star::chart2;
 
-namespace
-{
-
-struct XShapeCompare
-{
-    bool operator() (uno::Reference<drawing::XShape> const & lhs, uno::Reference<drawing::XShape> const & rhs) const
-    {
-        return lhs.get() < rhs.get();
-    }
-};
-
-struct XShapeHash
-{
-    bool operator()(uno::Reference<drawing::XShape> const & rXShape) const
-    {
-        return rXShape->getShapeType().hashCode();
-    }
-};
-
-} // end anonymous namespace
-
 BarChart::BarChart( const uno::Reference<XChartType>& xChartTypeModel
                     , sal_Int32 nDimensionCount )
         : VSeriesPlotter( xChartTypeModel, nDimensionCount )
@@ -501,7 +480,7 @@ void BarChart::createShapes()
     bool bDrawConnectionLinesInited = false;
     bool bOnlyConnectionLinesForThisPoint = false;
 
-    std::unordered_set<uno::Reference<drawing::XShape>, XShapeHash, XShapeCompare> aShapeSet;
+    std::unordered_set<uno::Reference<drawing::XShape>> aShapeSet;
 
     const comphelper::ScopeGuard aGuard([aShapeSet]() {
 
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index cf0b2b7efdd9..ba71089dc402 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -56,15 +56,10 @@ namespace comphelper {
 typedef std::unordered_map<OUString, uno::Reference<embed::XEmbeddedObject>> EmbeddedObjectContainerNameMap;
 struct EmbedImpl
 {
-    struct XEmbeddedObjectRefHash
-    {
-        size_t operator()(const uno::Reference<embed::XEmbeddedObject>& rObject) const
-            { return reinterpret_cast<size_t>(rObject.get()); }
-    };
     // TODO/LATER: remove objects from temp. Container storage when object is disposed
     EmbeddedObjectContainerNameMap maNameToObjectMap;
     // to speed up lookup by Reference
-    std::unordered_map<uno::Reference<embed::XEmbeddedObject>, OUString, XEmbeddedObjectRefHash> maObjectToNameMap;
+    std::unordered_map<uno::Reference<embed::XEmbeddedObject>, OUString> maObjectToNameMap;
     uno::Reference < embed::XStorage > mxStorage;
     EmbeddedObjectContainer* mpTempObjectContainer;
     uno::Reference < embed::XStorage > mxImageStorage;
diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx
index 535808a3a0ca..537885ad01e8 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -140,8 +140,6 @@ bool containsXInterfaceSubclass(const clang::Type* pType0) {
                     .GlobalNamespace())
                 || (dc.Class("OAutoRegistration").Namespace("comphelper")
                     .GlobalNamespace())
-                || (dc.Struct("OInterfaceCompare").Namespace("comphelper")
-                    .GlobalNamespace())
                 || dc.Class("WeakBag").Namespace("comphelper").GlobalNamespace()
                 || (dc.Struct("class_").Namespace("service_decl")
                     .Namespace("comphelper").GlobalNamespace())
diff --git a/connectivity/source/cpool/ZPoolCollection.hxx b/connectivity/source/cpool/ZPoolCollection.hxx
index ac675200f733..b11ce8dfc8eb 100644
--- a/connectivity/source/cpool/ZPoolCollection.hxx
+++ b/connectivity/source/cpool/ZPoolCollection.hxx
@@ -38,7 +38,6 @@
 #include <com/sun/star/frame/XDesktop2.hpp>
 #include <com/sun/star/frame/XTerminateListener.hpp>
 #include <com/sun/star/reflection/XProxyFactory.hpp>
-#include <comphelper/stl_types.hxx>
 #include <osl/mutex.hxx>
 #include <rtl/ref.hxx>
 
@@ -60,13 +59,11 @@ namespace connectivity
     {
 
 
-        typedef ::comphelper::OInterfaceCompare< css::sdbc::XDriver >  ODriverCompare;
         typedef std::map<OUString, rtl::Reference<OConnectionPool>> OConnectionPools;
 
         typedef std::map<
                 css::uno::Reference< css::sdbc::XDriver >,
-                css::uno::WeakReference< css::sdbc::XDriver >,
-                ODriverCompare>
+                css::uno::WeakReference< css::sdbc::XDriver >>
                 MapDriver2DriverRef;
 
         MapDriver2DriverRef                                       m_aDriverProxies;
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 82a5b8cc291c..c4b31eef77a7 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -147,14 +147,6 @@ struct PagePropertySet
     }
 };
 
-struct HashReferenceXInterface
-{
-    size_t operator()( const Reference< XInterface >& rxIf ) const
-    {
-        return reinterpret_cast< size_t >( rxIf.get() );
-    }
-};
-
 struct HashUChar
 {
     size_t operator()( const sal_Unicode uchar ) const { return static_cast< size_t >( uchar ); }
@@ -181,16 +173,16 @@ class SVGFilter : public cppu::WeakImplHelper < XFilter,
                                                  XExtendedFilterDetection >
 {
 public:
-    typedef std::unordered_map< Reference< XInterface >, ObjectRepresentation, HashReferenceXInterface >    ObjectMap;
-    typedef std::unordered_set< Reference< XInterface >, HashReferenceXInterface >                          ObjectSet;
+    typedef std::unordered_map< Reference< XInterface >, ObjectRepresentation >    ObjectMap;
+    typedef std::unordered_set< Reference< XInterface > >                          ObjectSet;
 
-    typedef std::unordered_set< sal_Unicode, HashUChar >                                                    UCharSet;
-    typedef std::unordered_map< OUString, UCharSet >                                          UCharSetMap;
-    typedef std::unordered_map< Reference< XInterface >, UCharSetMap, HashReferenceXInterface >             UCharSetMapMap;
+    typedef std::unordered_set< sal_Unicode, HashUChar >                           UCharSet;
+    typedef std::unordered_map< OUString, UCharSet >                               UCharSetMap;
+    typedef std::unordered_map< Reference< XInterface >, UCharSetMap >             UCharSetMapMap;
 
-    typedef std::unordered_map< Reference< XInterface >, OUString, HashReferenceXInterface >         UOStringMap;
+    typedef std::unordered_map< Reference< XInterface >, OUString >                UOStringMap;
 
-    typedef std::unordered_set< ObjectRepresentation, HashBitmap, EqualityBitmap >                  MetaBitmapActionSet;
+    typedef std::unordered_set< ObjectRepresentation, HashBitmap, EqualityBitmap > MetaBitmapActionSet;
 
 private:
 
diff --git a/include/com/sun/star/uno/Reference.hxx b/include/com/sun/star/uno/Reference.hxx
index d822c97aeb2d..c6869d922d7e 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -450,6 +450,26 @@ operator <<(
 }
 }
 
+#if defined LIBO_INTERNAL_ONLY
+namespace std
+{
+
+/**
+  Make css::uno::Reference hashable by default for use in STL containers.
+
+  @since LibreOffice 6.3
+*/
+template<typename T>
+struct hash<::css::uno::Reference<T>>
+{
+    std::size_t operator()(::css::uno::Reference<T> const & s) const
+    { return size_t(s.get()); }
+};
+
+}
+
+#endif
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessiblewrapper.hxx b/include/comphelper/accessiblewrapper.hxx
index 30f775f255e5..34b3cb8edad4 100644
--- a/include/comphelper/accessiblewrapper.hxx
+++ b/include/comphelper/accessiblewrapper.hxx
@@ -36,7 +36,6 @@
 #include <comphelper/uno3.hxx>
 #include <cppuhelper/interfacecontainer.h>
 #include <comphelper/accessibleeventnotifier.hxx>
-#include <comphelper/stl_types.hxx>
 #include <comphelper/comphelperdllapi.h>
 #include <rtl/ref.hxx>
 
@@ -317,7 +316,6 @@ namespace comphelper
 
     typedef ::std::map  <   css::uno::Reference< css::accessibility::XAccessible >
                         ,   css::uno::Reference< css::accessibility::XAccessible >
-                        ,   OInterfaceCompare< css::accessibility::XAccessible >
                         >   AccessibleMap;
                         // TODO: think about if we should hold these objects weak
 
diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx
index c166b5a7040e..e84f9d405dae 100644
--- a/include/comphelper/stl_types.hxx
+++ b/include/comphelper/stl_types.hxx
@@ -97,21 +97,6 @@ bool ContainerUniquePtrEquals(
 };
 
 
-/** STL-compliant structure for comparing Reference< <iface> > instances
-*/
-template < class IAFCE >
-struct OInterfaceCompare
-{
-    bool operator() (const css::uno::Reference< IAFCE >& lhs, const css::uno::Reference< IAFCE >& rhs) const
-    {
-        return lhs.get() < rhs.get();
-            // this does not make any sense if you see the semantics of the pointer returned by get:
-            // It's a pointer to a point in memory where an interface implementation lies.
-            // But for our purpose (provide a reliable less-operator which can be used with the STL), this is
-            // sufficient ....
-    }
-};
-
 template <class Tp, class Arg>
 class mem_fun1_t
 {
diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx
index b7755ccee9d2..a8ea2d5c6005 100644
--- a/include/oox/export/shapes.hxx
+++ b/include/oox/export/shapes.hxx
@@ -82,21 +82,9 @@ class OOX_DLLPUBLIC ShapeExport : public DrawingML {
 
 private:
     int m_nEmbeddedObjects;
-    struct ShapeCheck
-    {
-        bool operator()( const css::uno::Reference< css::drawing::XShape>& s1, const css::uno::Reference< css::drawing::XShape>& s2 ) const
-        {
-            return s1 == s2;
-        }
-    };
-
-    struct ShapeHash
-    {
-        size_t operator()( const css::uno::Reference < css::drawing::XShape >& ) const;
-    };
 
 public:
-    typedef std::unordered_map< css::uno::Reference< css::drawing::XShape>, sal_Int32, ShapeHash, ShapeCheck> ShapeHashMap;
+    typedef std::unordered_map< css::uno::Reference< css::drawing::XShape>, sal_Int32> ShapeHashMap;
 
 protected:
     sal_Int32           mnShapeIdMax, mnPictureIdMax;
diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx
index 437f7a34fc05..73c03ff7657d 100644
--- a/include/rtl/ref.hxx
+++ b/include/rtl/ref.hxx
@@ -23,6 +23,8 @@
 #include "sal/config.h"
 
 #include <cassert>
+#include <cstddef>
+#include <functional>
 
 #include "sal/types.h"
 
@@ -250,6 +252,28 @@ public:
 
 } // namespace rtl
 
+#if defined LIBO_INTERNAL_ONLY
+namespace std
+{
+
+/// @cond INTERNAL
+/**
+  Make rtl::Reference hashable by default for use in STL containers.
+
+  @since LibreOffice 6.3
+*/
+template<typename T>
+struct hash<::rtl::Reference<T>>
+{
+    std::size_t operator()(::rtl::Reference<T> const & s) const
+    { return std::size_t(s.get()); }
+};
+/// @endcond
+
+}
+
+#endif
+
 #endif /* ! INCLUDED_RTL_REF_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/fmtools.hxx b/include/svx/fmtools.hxx
index 000f3032ca83..6322cc3720d0 100644
--- a/include/svx/fmtools.hxx
+++ b/include/svx/fmtools.hxx
@@ -58,7 +58,6 @@
 #include <rtl/ref.hxx>
 #include <tools/wintypes.hxx>
 #include <cppuhelper/weakref.hxx>
-#include <comphelper/stl_types.hxx>
 #include <cppuhelper/implbase.hxx>
 
 #include <set>
@@ -189,9 +188,7 @@ bool isRowSetAlive(const css::uno::Reference< css::uno::XInterface>& _rxRowSet);
     // checks if the css::sdbcx::XColumnsSupplier provided by _rxRowSet supplies any columns
 
 
-typedef ::std::set  < css::uno::Reference< css::uno::XInterface >
-                    , ::comphelper::OInterfaceCompare< css::uno::XInterface >
-                    > InterfaceBag;
+typedef ::std::set< css::uno::Reference< css::uno::XInterface > > InterfaceBag;
 
 #endif // INCLUDED_SVX_FMTOOLS_HXX
 
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index b070761b2b60..ba6938928bbe 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -37,29 +37,8 @@ using namespace ::com::sun::star::connection;
 
 
 namespace io_acceptor {
-    template<class T>
-    struct ReferenceHash
-    {
-        size_t operator () (const css::uno::Reference<T> & ref) const
-        {
-            return reinterpret_cast<size_t>(ref.get());
-        }
-    };
-
-    template<class T>
-    struct ReferenceEqual
-    {
-        bool operator () (const css::uno::Reference<T> & op1,
-                          const css::uno::Reference<T> & op2) const
-        {
-            return op1.get() == op2.get();
-        }
-    };
-
 
-    typedef std::unordered_set< css::uno::Reference< css::io::XStreamListener>,
-                                ReferenceHash< css::io::XStreamListener>,
-                                ReferenceEqual< css::io::XStreamListener> >
+    typedef std::unordered_set< css::uno::Reference< css::io::XStreamListener> >
             XStreamListener_hash_set;
 
 
diff --git a/io/source/connector/connector.hxx b/io/source/connector/connector.hxx
index 1c5b585c5e68..9aad55a45dfa 100644
--- a/io/source/connector/connector.hxx
+++ b/io/source/connector/connector.hxx
@@ -31,28 +31,7 @@
 
 namespace stoc_connector
 {
-    template<class T>
-    struct ReferenceHash
-    {
-        size_t operator () (const css::uno::Reference<T> & ref) const
-        {
-            return reinterpret_cast<size_t>(ref.get());
-        }
-    };
-
-    template<class T>
-    struct ReferenceEqual
-    {
-        bool operator () (const css::uno::Reference<T> & op1,
-                          const css::uno::Reference<T> & op2) const
-        {
-            return op1.get() == op2.get();
-        }
-    };
-
-    typedef std::unordered_set< css::uno::Reference< css::io::XStreamListener>,
-                                ReferenceHash< css::io::XStreamListener>,
-                                ReferenceEqual< css::io::XStreamListener> >
+    typedef std::unordered_set< css::uno::Reference< css::io::XStreamListener> >
             XStreamListener_hash_set;
 
     class PipeConnection :
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 5005459ffddf..7302682b02b0 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -2077,11 +2077,6 @@ ShapeExport& ShapeExport::WriteUnknownShape( const Reference< XShape >& )
     return *this;
 }
 
-size_t ShapeExport::ShapeHash::operator()( const Reference < XShape >& rXShape ) const
-{
-    return rXShape->getShapeType().hashCode();
-}
-
 sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape >& rXShape )
 {
     return GetNewShapeID( rXShape, GetFB() );
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index 0b3e081df367..6f409a769baa 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -39,7 +39,6 @@
 #include <connectivity/dbtools.hxx>
 #include <svl/hint.hxx>
 #include <tools/diagnose_ex.h>
-#include <comphelper/stl_types.hxx>
 #include <vcl/svapp.hxx>
 #include <dbaccess/dbsubcomponentcontroller.hxx>
 #include <svx/unoshape.hxx>
@@ -82,7 +81,7 @@ struct ObjectInfo
     }
 };
 
-typedef ::std::map< Reference< XPropertySet >, ObjectInfo, ::comphelper::OInterfaceCompare< XPropertySet > >    PropertySetInfoCache;
+typedef ::std::map< Reference< XPropertySet >, ObjectInfo >    PropertySetInfoCache;
 
 
 class OXUndoEnvironmentImpl
diff --git a/scripting/source/provider/ActiveMSPList.hxx b/scripting/source/provider/ActiveMSPList.hxx
index 7539b3ba4f36..8a6e53cf891d 100644
--- a/scripting/source/provider/ActiveMSPList.hxx
+++ b/scripting/source/provider/ActiveMSPList.hxx
@@ -30,8 +30,6 @@
 #include <com/sun/star/script/provider/XScriptProvider.hpp>
 #include <com/sun/star/document/XScriptInvocationContext.hpp>
 
-#include <comphelper/stl_types.hxx>
-
 #include <map>
 #include <unordered_map>
 
@@ -41,7 +39,6 @@ namespace func_provider
 //Typedefs
 typedef std::map  <   css::uno::Reference< css::uno::XInterface >
                   ,   css::uno::Reference< css::script::provider::XScriptProvider >
-                  ,   ::comphelper::OInterfaceCompare< css::uno::XInterface >
                   >   ScriptComponent_map;
 
 typedef std::unordered_map< OUString,
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index d6eac9b1ccf0..81435c183631 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -133,28 +133,8 @@ Sequence< OUString > retrieveAsciiValueList(
 /*****************************************************************************
     Enumeration by ServiceName
 *****************************************************************************/
-struct hashRef_Impl
-{
-    size_t operator()(const Reference<XInterface > & rName) const
-    {
-        // query to XInterface. The cast to XInterface* must be the same for the same object
-        Reference<XInterface > x( Reference<XInterface >::query( rName ) );
-        return reinterpret_cast<size_t>(x.get());
-    }
-};
 
-struct equaltoRef_Impl
-{
-    bool operator()(const Reference<XInterface > & rName1, const Reference<XInterface > & rName2 ) const
-        { return rName1 == rName2; }
-};
-
-typedef std::unordered_set
-<
-    Reference<XInterface >,
-    hashRef_Impl,
-    equaltoRef_Impl
-> HashSet_Ref;
+typedef std::unordered_set< Reference<XInterface > > HashSet_Ref;
 
 
 class ServiceEnumeration_Impl : public WeakImplHelper< XEnumeration >
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index 8ca89e14aab7..8002617b9a29 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -118,7 +118,7 @@ namespace
         }
     };
 
-    typedef ::std::map< Reference< XControlModel >, Reference< XControlModel >, ::comphelper::OInterfaceCompare< XControlModel > > MapControlModels;
+    typedef ::std::map< Reference< XControlModel >, Reference< XControlModel > > MapControlModels;
 
     class FormComponentAssignment
     {
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 244b9d5b5407..cd641a0bd9de 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -86,8 +86,7 @@ namespace svxform
     // helper
 
 
-    typedef ::std::map< Reference< XInterface >, SdrObject*, ::comphelper::OInterfaceCompare< XInterface > >
-            MapModelToShape;
+    typedef ::std::map< Reference< XInterface >, SdrObject* > MapModelToShape;
 
 
     static void    collectShapeModelMapping( SdrPage const * _pPage, MapModelToShape& _rMapping )
diff --git a/svx/source/inc/fmcontrolbordermanager.hxx b/svx/source/inc/fmcontrolbordermanager.hxx
index 9375d02934a5..5b12dbc4d50f 100644
--- a/svx/source/inc/fmcontrolbordermanager.hxx
+++ b/svx/source/inc/fmcontrolbordermanager.hxx
@@ -24,7 +24,6 @@
 #include <com/sun/star/awt/FontUnderline.hpp>
 #include <com/sun/star/awt/XControl.hpp>
 #include <com/sun/star/awt/XVclWindowPeer.hpp>
-#include <comphelper/stl_types.hxx>
 #include <o3tl/typed_flags_set.hxx>
 #include <tools/color.hxx>
 
@@ -111,8 +110,7 @@ namespace svxform
         };
 
         typedef ::std::set< ControlData, ControlDataCompare > ControlBag;
-        typedef ::std::set< css::uno::Reference< css::awt::XVclWindowPeer >,
-                            ::comphelper::OInterfaceCompare< css::awt::XVclWindowPeer > >  PeerBag;
+        typedef ::std::set< css::uno::Reference< css::awt::XVclWindowPeer > >  PeerBag;
 
         PeerBag     m_aColorableControls;
         PeerBag     m_aNonColorableControls;
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index 59f8647b102e..5696e8291f33 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -41,7 +41,6 @@
 #include <com/sun/star/sdbc/XDataSource.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 
-#include <comphelper/stl_types.hxx>
 #include <tools/link.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <rtl/ref.hxx>
@@ -130,13 +129,8 @@ private:
 
 typedef ::rtl::Reference< FormViewPageWindowAdapter >   PFormViewPageWindowAdapter;
 typedef ::std::vector< PFormViewPageWindowAdapter >     PageWindowAdapterList;
-typedef ::std::set  <   css::uno::Reference< css::form::XForm >
-                    ,   ::comphelper::OInterfaceCompare< css::form::XForm >
-                    >   SetOfForms;
-typedef ::std::map  <   css::uno::Reference< css::awt::XControlContainer >
-                    ,   SetOfForms
-                    ,   ::comphelper::OInterfaceCompare< css::awt::XControlContainer >
-                    >   MapControlContainerToSetOfForms;
+typedef ::std::set< css::uno::Reference< css::form::XForm > > SetOfForms;
+typedef ::std::map< css::uno::Reference< css::awt::XControlContainer >, SetOfForms > MapControlContainerToSetOfForms;
 class SdrModel;
 
 class FmXFormView : public ::cppu::WeakImplHelper<
diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx
index dd88dd45cf9d..62b211b8992a 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -51,15 +51,7 @@ using namespace ::com::sun::star::container;
 namespace accessibility
 {
 
-struct hash
-{
-    std::size_t operator()( const Reference< XCell >& xCell ) const
-    {
-        return std::size_t( xCell.get() );
-    }
-};
-
-typedef std::unordered_map< Reference< XCell >, rtl::Reference< AccessibleCell >, hash > AccessibleCellMap;
+typedef std::unordered_map< Reference< XCell >, rtl::Reference< AccessibleCell > > AccessibleCellMap;
 
 class AccessibleTableShapeImpl : public cppu::WeakImplHelper< XModifyListener >
 {
diff --git a/xmloff/source/forms/eventimport.hxx b/xmloff/source/forms/eventimport.hxx
index f696e81a924a..da1d765cf5da 100644
--- a/xmloff/source/forms/eventimport.hxx
+++ b/xmloff/source/forms/eventimport.hxx
@@ -26,7 +26,6 @@
 
 #include <xmloff/XMLEventsImportContext.hxx>
 #include "callbacks.hxx"
-#include "ifacecompare.hxx"
 #include <com/sun/star/container/XIndexAccess.hpp>
 
 class SvXMLImport;
@@ -51,8 +50,7 @@ namespace xmloff
     {
         typedef std::map<
             css::uno::Reference< css::beans::XPropertySet >,
-            css::uno::Sequence< css::script::ScriptEventDescriptor >,
-            OPropertySetCompare>
+            css::uno::Sequence< css::script::ScriptEventDescriptor >>
             MapPropertySet2ScriptSequence;
         // usually an event attacher manager will need to collect all script events registered, 'cause
         // the _real_ XEventAttacherManager handles it's events by index, but out indices are not fixed
diff --git a/xmloff/source/forms/ifacecompare.hxx b/xmloff/source/forms/ifacecompare.hxx
deleted file mode 100644
index 79b4bae04b2e..000000000000
--- a/xmloff/source/forms/ifacecompare.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_XMLOFF_SOURCE_FORMS_IFACECOMPARE_HXX
-#define INCLUDED_XMLOFF_SOURCE_FORMS_IFACECOMPARE_HXX
-
-#include <comphelper/stl_types.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/drawing/XDrawPage.hpp>
-
-namespace xmloff
-{
-
-    //= OInterfaceCompare
-    /** is stl-compliant structure for comparing Reference< <iface> > instances
-    */
-    template < class IAFCE >
-    struct OInterfaceCompare
-    {
-        bool operator() (const css::uno::Reference< IAFCE >& lhs, const css::uno::Reference< IAFCE >& rhs) const
-        {
-            return lhs.get() < rhs.get();
-                // this does not make any sense if you see the semantics of the pointer returned by get:
-                // It's a pointer to a point in memory where an interface implementation lies.
-                // But for our purpose (provide a reliable less-operator which can be used with the STL), this is
-                // sufficient ....
-        }
-    };
-
-    typedef OInterfaceCompare< css::beans::XPropertySet >  OPropertySetCompare;
-    typedef OInterfaceCompare< css::drawing::XDrawPage >   ODrawPageCompare;
-
-}   // namespace xmloff
-
-#endif // INCLUDED_XMLOFF_SOURCE_FORMS_IFACECOMPARE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/forms/layerexport.hxx b/xmloff/source/forms/layerexport.hxx
index 5a2ae2e7f8ad..163be842343e 100644
--- a/xmloff/source/forms/layerexport.hxx
+++ b/xmloff/source/forms/layerexport.hxx
@@ -26,11 +26,11 @@
 #include <set>
 
 #include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/script/ScriptEventDescriptor.hpp>
 #include <com/sun/star/util/XNumberFormats.hpp>
 #include <com/sun/star/awt/XControlModel.hpp>
 #include "callbacks.hxx"
-#include "ifacecompare.hxx"
 #include <rtl/ref.hxx>
 
 class SvXMLExport;
@@ -42,19 +42,16 @@ namespace xmloff
 {
 
     typedef ::std::set  <   css::uno::Reference< css::beans::XPropertySet >
-                        ,   OPropertySetCompare
                         >   PropertySetBag;
 
     // maps objects (property sets) to strings, e.g. control ids.
     typedef ::std::map  <   css::uno::Reference< css::beans::XPropertySet >
                         ,   OUString
-                        ,   OPropertySetCompare
                         >   MapPropertySet2String;
 
     // map pages to maps (of property sets to strings)
     typedef ::std::map  <   css::uno::Reference< css::drawing::XDrawPage >
                         ,   MapPropertySet2String
-                        ,   ODrawPageCompare
                         >   MapPropertySet2Map;
 
     //= OFormLayerXMLExport_Impl
@@ -111,7 +108,7 @@ namespace xmloff
         // TODO: To avoid this construct above, and to have a cleaner implementation, an class encapsulating the
         // export of a single page should be introduced.
 
-        typedef std::map<css::uno::Reference<css::beans::XPropertySet>, sal_Int32, OPropertySetCompare> MapPropertySet2Int;
+        typedef std::map<css::uno::Reference<css::beans::XPropertySet>, sal_Int32> MapPropertySet2Int;
         MapPropertySet2Int  m_aControlNumberFormats;
             // maps controls to format keys, which are relative to our own formats supplier
 
diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx
index a6fbad3c7292..515fffe464ff 100644
--- a/xmloff/source/forms/layerimport.hxx
+++ b/xmloff/source/forms/layerimport.hxx
@@ -25,6 +25,7 @@
 #include <map>
 
 #include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/form/XFormsSupplier2.hpp>
 #include <rtl/ref.hxx>
 #include "formattributes.hxx"
@@ -60,7 +61,7 @@ namespace xmloff
         rtl::Reference<SvXMLStylesContext>  m_xAutoStyles;
 
         typedef std::map< OUString, css::uno::Reference< css::beans::XPropertySet > > MapString2PropertySet;
-        typedef std::map<css::uno::Reference<css::drawing::XDrawPage>, MapString2PropertySet, ODrawPageCompare> MapDrawPage2Map;
+        typedef std::map<css::uno::Reference<css::drawing::XDrawPage>, MapString2PropertySet> MapDrawPage2Map;
 
         MapDrawPage2Map         m_aControlIds;          // ids of the controls on all known page
         MapDrawPage2Map::iterator m_aCurrentPageIds;      // ifs of the controls on the current page


More information about the Libreoffice-commits mailing list