From e1cb749aab3c773073b1adde1b4cd07b2a6ce93e Mon Sep 17 00:00:00 2001 From: Jan Lingscheid Date: Tue, 17 Oct 2017 08:31:32 +0200 Subject: Replace boost::shared_ptr Replace boost::shared_ptr with C++11 smartpointer and remove the boost/shared_ptr.hpp header. --- src/ui/tool/manipulator.h | 7 +++---- src/ui/tool/multi-path-manipulator.cpp | 5 ++--- src/ui/tool/multi-path-manipulator.h | 8 ++++---- src/ui/tool/node.h | 8 +++----- src/ui/tool/path-manipulator.h | 4 +--- 5 files changed, 13 insertions(+), 19 deletions(-) (limited to 'src/ui') diff --git a/src/ui/tool/manipulator.h b/src/ui/tool/manipulator.h index 0f26c6de1..66b47ce98 100644 --- a/src/ui/tool/manipulator.h +++ b/src/ui/tool/manipulator.h @@ -17,7 +17,6 @@ #include #include #include -#include #include "ui/tools/tool-base.h" class SPDesktop; @@ -76,14 +75,14 @@ template class MultiManipulator : public PointManipulator { public: //typedef typename T::ItemType ItemType; - typedef typename std::pair > MapPair; - typedef typename std::map > MapType; + typedef typename std::pair > MapPair; + typedef typename std::map > MapType; MultiManipulator(SPDesktop *d, ControlPointSelection &sel) : PointManipulator(d, sel) {} void addItem(void *item) { - boost::shared_ptr m(_createManipulator(item)); + std::shared_ptr m(_createManipulator(item)); _mmap.insert(MapPair(item, m)); } void removeItem(void *item) { diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index f30c7e349..9cfa4ed31 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -10,7 +10,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include #include "node.h" #include #include "desktop.h" @@ -161,7 +160,7 @@ void MultiPathManipulator::setItems(std::set const &s) if (sr.edit_transform != sr_new.edit_transform || sr.role != sr_new.role) { - boost::shared_ptr hold(i->second); + std::shared_ptr hold(i->second); if (sr.edit_transform != sr_new.edit_transform) hold->setControlsTransform(sr_new.edit_transform); if (sr.role != sr_new.role) { @@ -179,7 +178,7 @@ void MultiPathManipulator::setItems(std::set const &s) for (std::set::iterator i = shapes.begin(); i != shapes.end(); ++i) { ShapeRecord const &r = *i; if (!SP_IS_PATH(r.item) && !IS_LIVEPATHEFFECT(r.item)) continue; - boost::shared_ptr newpm(new PathManipulator(*this, (SPPath*) r.item, + std::shared_ptr newpm(new PathManipulator(*this, (SPPath*) r.item, r.edit_transform, _getOutlineColor(r.role, r.item), r.lpe_key)); newpm->showHandles(_show_handles); // always show outlines for clips and masks diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h index 4f152e0a2..742c6d421 100644 --- a/src/ui/tool/multi-path-manipulator.h +++ b/src/ui/tool/multi-path-manipulator.h @@ -77,8 +77,8 @@ public: sigc::signal signal_coords_changed; /// Emitted whenever the coordinates /// shown in the status bar need updating private: - typedef std::pair > MapPair; - typedef std::map > MapType; + typedef std::pair > MapPair; + typedef std::map > MapType; template void invokeForAll(R (PathManipulator::*method)()) { @@ -88,11 +88,11 @@ private: // be a valid iterator and then assign i to it. MapType::iterator next_i = i; ++next_i; - // i->second is a boost::shared_ptr so try to hold on to it so + // i->second is a std::shared_ptr so try to hold on to it so // it won't get freed prematurely by the WriteXML() method or // whatever. See https://bugs.launchpad.net/inkscape/+bug/1617615 // Applicable to empty paths. - boost::shared_ptr hold(i->second); + std::shared_ptr hold(i->second); ((hold.get())->*method)(); i = next_i; } diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h index a05f0e3b9..2964b66ca 100644 --- a/src/ui/tool/node.h +++ b/src/ui/tool/node.h @@ -22,8 +22,6 @@ #include #include -#include -#include #include "ui/tool/selectable-control-point.h" #include "snapped-point.h" #include "ui/tool/node-types.h" @@ -357,7 +355,7 @@ private: friend class NodeList; }; -class NodeList : ListNode, boost::noncopyable, public boost::enable_shared_from_this { +class NodeList : ListNode, boost::noncopyable { public: typedef std::size_t size_type; typedef Node &reference; @@ -465,9 +463,9 @@ private: * List of node lists. Represents an editable path. * Editable path composed of one or more subpaths. */ -class SubpathList : public std::list< boost::shared_ptr > { +class SubpathList : public std::list< std::shared_ptr > { public: - typedef std::list< boost::shared_ptr > list_type; + typedef std::list< std::shared_ptr > list_type; SubpathList(PathManipulator &pm) : _path_manipulator(pm) {} PathManipulator &pm() { return _path_manipulator; } diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index 283cb610a..5fa24c23b 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -15,8 +15,6 @@ #include #include <2geom/pathvector.h> #include <2geom/affine.h> -#include -#include #include "ui/tool/node.h" #include "ui/tool/manipulator.h" #include "live_effects/lpe-bspline.h" @@ -105,7 +103,7 @@ public: static bool is_item_type(void *item); private: typedef NodeList Subpath; - typedef boost::shared_ptr SubpathPtr; + typedef std::shared_ptr SubpathPtr; void _createControlPointsFromGeometry(); -- cgit v1.2.3