diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-02-01 11:38:19 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-02-01 11:52:51 +0100 |
commit | 3195fce9bd2661ef4e6136e25e383fb95a362796 (patch) | |
tree | 47b2f956db61ca373e5361592299556de151799d /include/vcl/graph.hxx | |
parent | 62222b40973fa71eba6c77bdd85be30864350f3f (diff) |
hash implementation for Graphic objects, for set/map use
Change-Id: I58547ad90d1aba6b1734a547c8138d1476c4b813
Reviewed-on: https://gerrit.libreoffice.org/49072
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/vcl/graph.hxx')
-rw-r--r-- | include/vcl/graph.hxx | 18 |
1 files changed, 18 insertions, 0 deletions
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: */ |