include/vcl/graph.hxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
New commits: commit 3195fce9bd2661ef4e6136e25e383fb95a362796 Author: Tomaž Vajngerl <[email protected]> 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 <[email protected]> Reviewed-by: Tomaž Vajngerl <[email protected]> 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: */ _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
