From 7663e55d418b5ea8765421c9570dba40f6bd97fd Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Wed, 15 Mar 2006 03:22:23 +0000 Subject: shared_ptr -> ptr_shared (bzr r240) --- src/xml/simple-node.cpp | 58 ++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/xml/simple-node.cpp') diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp index d83e5d54b..17339271f 100644 --- a/src/xml/simple-node.cpp +++ b/src/xml/simple-node.cpp @@ -28,7 +28,7 @@ namespace XML { namespace { -Util::shared_ptr stringify_node(Node const &node) { +Util::ptr_shared stringify_node(Node const &node) { gchar *string; switch (node.type()) { case ELEMENT_NODE: { @@ -51,14 +51,14 @@ Util::shared_ptr stringify_node(Node const &node) { default: string = g_strdup_printf("unknown(%p)", &node); } - Util::shared_ptr result=Util::share_string(string); + Util::ptr_shared result=Util::share_string(string); g_free(string); return result; } -Util::shared_ptr stringify_unsigned(unsigned n) { +Util::ptr_shared stringify_unsigned(unsigned n) { gchar *string = g_strdup_printf("%u", n); - Util::shared_ptr result=Util::share_string(string); + Util::ptr_shared result=Util::share_string(string); g_free(string); return result; } @@ -75,7 +75,7 @@ public: static Category category() { return XML; } - Util::shared_ptr name() const { + Util::ptr_shared name() const { return Util::share_static_string("add-child"); } unsigned propertyCount() const { return 3; } @@ -92,8 +92,8 @@ public: } } private: - Util::shared_ptr _parent; - Util::shared_ptr _child; + Util::ptr_shared _parent; + Util::ptr_shared _child; unsigned _position; }; @@ -106,7 +106,7 @@ public: static Category category() { return XML; } - Util::shared_ptr name() const { + Util::ptr_shared name() const { return Util::share_static_string("remove-child"); } unsigned propertyCount() const { return 2; } @@ -121,8 +121,8 @@ public: } } private: - Util::shared_ptr _parent; - Util::shared_ptr _child; + Util::ptr_shared _parent; + Util::ptr_shared _child; }; class DebugSetChildPosition : public Debug::Event { @@ -140,7 +140,7 @@ public: static Category category() { return XML; } - Util::shared_ptr name() const { + Util::ptr_shared name() const { return Util::share_static_string("set-child-position"); } unsigned propertyCount() const { return 3; } @@ -157,21 +157,21 @@ public: } } private: - Util::shared_ptr _parent; - Util::shared_ptr _child; + Util::ptr_shared _parent; + Util::ptr_shared _child; unsigned _position; }; class DebugSetContent : public Debug::Event { public: DebugSetContent(Node const &node, - Util::shared_ptr old_content, - Util::shared_ptr new_content) + Util::ptr_shared old_content, + Util::ptr_shared new_content) : _node(stringify_node(node)), _content(new_content) {} static Category category() { return XML; } - Util::shared_ptr name() const { + Util::ptr_shared name() const { if (_content) { return Util::share_static_string("set-content"); } else { @@ -196,22 +196,22 @@ public: } } private: - Util::shared_ptr _node; - Util::shared_ptr _content; + Util::ptr_shared _node; + Util::ptr_shared _content; }; class DebugSetAttribute : public Debug::Event { public: DebugSetAttribute(Node const &node, GQuark name, - Util::shared_ptr old_value, - Util::shared_ptr new_value) + Util::ptr_shared old_value, + Util::ptr_shared new_value) : _node(stringify_node(node)), _name(Util::share_unsafe(g_quark_to_string(name))), _value(new_value) {} static Category category() { return XML; } - Util::shared_ptr name() const { + Util::ptr_shared name() const { if (_value) { return Util::share_static_string("set-attribute"); } else { @@ -239,12 +239,12 @@ public: } private: - Util::shared_ptr _node; - Util::shared_ptr _name; - Util::shared_ptr _value; + Util::ptr_shared _node; + Util::ptr_shared _name; + Util::ptr_shared _value; }; -using Inkscape::Util::shared_ptr; +using Inkscape::Util::ptr_shared; using Inkscape::Util::share_string; using Inkscape::Util::share_unsafe; using Inkscape::Util::share_static_string; @@ -366,8 +366,8 @@ bool SimpleNode::matchAttributeName(gchar const *partial_name) const { } void SimpleNode::setContent(gchar const *content) { - shared_ptr old_content=_content; - shared_ptr new_content = ( content ? share_string(content) : shared_ptr() ); + ptr_shared old_content=_content; + ptr_shared new_content = ( content ? share_string(content) : ptr_shared() ); Debug::EventTracker tracker( *this, old_content, new_content @@ -402,9 +402,9 @@ SimpleNode::setAttribute(gchar const *name, gchar const *value, bool const is_in Debug::EventTracker<> tracker; - shared_ptr old_value=( existing ? existing->value : shared_ptr() ); + ptr_shared old_value=( existing ? existing->value : ptr_shared() ); - shared_ptr new_value=shared_ptr(); + ptr_shared new_value=ptr_shared(); if (value) { new_value = share_string(value); tracker.set(*this, key, old_value, new_value); -- cgit v1.2.3