From 91b1b6cec4776d8c2e48b54e16d698abcea6bbfe Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 4 Mar 2010 22:54:38 +0100 Subject: Clean up the unordered containers fix. (bzr r9142) --- src/ui/tool/control-point-selection.h | 17 +++-------------- src/ui/tool/multi-path-manipulator.cpp | 13 +++++++++++-- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h index 6efb63b67..514ecb2e3 100644 --- a/src/ui/tool/control-point-selection.h +++ b/src/ui/tool/control-point-selection.h @@ -14,13 +14,13 @@ #include #include -#include "util/set-types.h" #include #include <2geom/forward.h> #include <2geom/point.h> #include <2geom/rect.h> #include "display/display-forward.h" #include "util/accumulators.h" +#include "util/unordered-containers.h" #include "ui/tool/commit-events.h" #include "ui/tool/manipulator.h" @@ -33,17 +33,6 @@ class SelectableControlPoint; } } -#ifdef USE_GNU_HASHES -namespace __gnu_cxx { -template<> -struct hash { - size_t operator()(Inkscape::UI::SelectableControlPoint *p) const { - return reinterpret_cast(p); - } -}; -} // namespace __gnu_cxx -#endif // USE_GNU_HASHES - namespace Inkscape { namespace UI { @@ -51,7 +40,7 @@ class ControlPointSelection : public Manipulator, public sigc::trackable { public: ControlPointSelection(SPDesktop *d, SPCanvasGroup *th_group); ~ControlPointSelection(); - typedef optim_set< SelectableControlPoint * > set_type; + typedef INK_UNORDERED_SET set_type; typedef set_type Set; // convenience alias typedef set_type::iterator iterator; @@ -142,7 +131,7 @@ private: set_type _points; set_type _all_points; - optim_map _original_positions; + INK_UNORDERED_MAP _original_positions; boost::optional _rot_radius; boost::optional _mouseover_rot_radius; Geom::OptRect _bounds; diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index d86a7e9e0..b79a29437 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -8,7 +8,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "util/set-types.h" #include #include #include @@ -24,6 +23,7 @@ #include "ui/tool/node.h" #include "ui/tool/multi-path-manipulator.h" #include "ui/tool/path-manipulator.h" +#include "util/unordered-containers.h" #ifdef USE_GNU_HASHES namespace __gnu_cxx { @@ -40,9 +40,18 @@ namespace Inkscape { namespace UI { namespace { + +struct hash_nodelist_iterator + : public std::unary_function +{ + std::size_t operator()(NodeList::iterator i) const { + return INK_HASH()(&*i); + } +}; + typedef std::pair IterPair; typedef std::vector IterPairList; -typedef optim_set IterSet; +typedef INK_UNORDERED_SET IterSet; typedef std::multimap DistanceMap; typedef std::pair DistanceMapItem; -- cgit v1.2.3