[Libreoffice-commits] core.git: include/vcl

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Thu Feb 1 10:53:16 UTC 2018


 include/vcl/graph.hxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 3195fce9bd2661ef4e6136e25e383fb95a362796
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu Feb 1 11:38:19 2018 +0900

    hash implementation for Graphic objects, for set/map use
    
    Change-Id: I58547ad90d1aba6b1734a547c8138d1476c4b813
    Reviewed-on: https://gerrit.libreoffice.org/49072
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index ad5471ca439e..f0a528c84b42 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -191,6 +191,11 @@ public:
 
     BitmapChecksum  GetChecksum() const;
 
+    SAL_DLLPRIVATE std::size_t getHash() const
+    {
+        return reinterpret_cast<std::size_t>(ImplGetImpGraphic());
+    }
+
 public:
 
     std::shared_ptr<GraphicReader>& GetContext();
@@ -227,6 +232,19 @@ public:
     static css::uno::Sequence<sal_Int8> getUnoTunnelId();
 };
 
+namespace std {
+
+template <>
+struct hash<Graphic>
+{
+    std::size_t operator()(Graphic const & rGraphic) const
+    {
+        return rGraphic.getHash();
+    }
+};
+
+} // end namespace std
+
 #endif // INCLUDED_VCL_GRAPH_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list