summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/attribute-record.h6
-rw-r--r--src/xml/comment-node.h2
-rw-r--r--src/xml/composite-node-observer.cpp8
-rw-r--r--src/xml/composite-node-observer.h8
-rw-r--r--src/xml/event.cpp20
-rw-r--r--src/xml/event.h18
-rw-r--r--src/xml/log-builder.cpp8
-rw-r--r--src/xml/log-builder.h8
-rw-r--r--src/xml/node-observer.h10
-rw-r--r--src/xml/repr-io.cpp13
-rw-r--r--src/xml/repr.cpp6
-rw-r--r--src/xml/simple-node.cpp83
-rw-r--r--src/xml/simple-node.h2
-rw-r--r--src/xml/simple-session.cpp12
-rw-r--r--src/xml/simple-session.h8
-rw-r--r--src/xml/text-node.h2
16 files changed, 109 insertions, 105 deletions
diff --git a/src/xml/attribute-record.h b/src/xml/attribute-record.h
index dbad0f340..30d8576d0 100644
--- a/src/xml/attribute-record.h
+++ b/src/xml/attribute-record.h
@@ -4,7 +4,7 @@
#include <glib/gquark.h>
#include <glib/gtypes.h>
#include "gc-managed.h"
-#include "util/shared-c-string-ptr.h"
+#include "util/share.h"
#define SP_REPR_ATTRIBUTE_KEY(a) g_quark_to_string((a)->key)
#define SP_REPR_ATTRIBUTE_VALUE(a) ((a)->value)
@@ -13,11 +13,11 @@ namespace Inkscape {
namespace XML {
struct AttributeRecord : public Inkscape::GC::Managed<> {
- AttributeRecord(GQuark k, Inkscape::Util::SharedCStringPtr v)
+ AttributeRecord(GQuark k, Inkscape::Util::shared_ptr<char> v)
: key(k), value(v) {}
GQuark key;
- Inkscape::Util::SharedCStringPtr value;
+ Inkscape::Util::shared_ptr<char> value;
// accept default copy constructor and assignment operator
};
diff --git a/src/xml/comment-node.h b/src/xml/comment-node.h
index dccc5e864..e41a36b59 100644
--- a/src/xml/comment-node.h
+++ b/src/xml/comment-node.h
@@ -23,7 +23,7 @@ namespace Inkscape {
namespace XML {
struct CommentNode : public SimpleNode {
- explicit CommentNode(Util::SharedCStringPtr content)
+ explicit CommentNode(Util::shared_ptr<char> content)
: SimpleNode(g_quark_from_static_string("comment"))
{
setContent(content);
diff --git a/src/xml/composite-node-observer.cpp b/src/xml/composite-node-observer.cpp
index 97bce9360..b564da78d 100644
--- a/src/xml/composite-node-observer.cpp
+++ b/src/xml/composite-node-observer.cpp
@@ -66,7 +66,7 @@ void CompositeNodeObserver::notifyChildOrderChanged(Node &node, Node &child,
void CompositeNodeObserver::notifyContentChanged(
Node &node,
- Util::SharedCStringPtr old_content, Util::SharedCStringPtr new_content
+ Util::shared_ptr<char> old_content, Util::shared_ptr<char> new_content
) {
_startIteration();
for ( ObserverRecordList::iterator iter=_active.begin() ;
@@ -81,7 +81,7 @@ void CompositeNodeObserver::notifyContentChanged(
void CompositeNodeObserver::notifyAttributeChanged(
Node &node, GQuark name,
- Util::SharedCStringPtr old_value, Util::SharedCStringPtr new_value
+ Util::shared_ptr<char> old_value, Util::shared_ptr<char> new_value
) {
_startIteration();
for ( ObserverRecordList::iterator iter=_active.begin() ;
@@ -130,13 +130,13 @@ public:
}
}
- void notifyContentChanged(Node &node, Util::SharedCStringPtr old_content, Util::SharedCStringPtr new_content) {
+ void notifyContentChanged(Node &node, Util::shared_ptr<char> old_content, Util::shared_ptr<char> new_content) {
if (vector.content_changed) {
vector.content_changed(&node, old_content, new_content, data);
}
}
- void notifyAttributeChanged(Node &node, GQuark name, Util::SharedCStringPtr old_value, Util::SharedCStringPtr new_value) {
+ void notifyAttributeChanged(Node &node, GQuark name, Util::shared_ptr<char> old_value, Util::shared_ptr<char> new_value) {
if (vector.attr_changed) {
vector.attr_changed(&node, g_quark_to_string(name), old_value, new_value, false, data);
}
diff --git a/src/xml/composite-node-observer.h b/src/xml/composite-node-observer.h
index 6568a1099..4acde0b4c 100644
--- a/src/xml/composite-node-observer.h
+++ b/src/xml/composite-node-observer.h
@@ -51,12 +51,12 @@ public:
Node *old_prev, Node *new_prev);
void notifyContentChanged(Node &node,
- Util::SharedCStringPtr old_content,
- Util::SharedCStringPtr new_content);
+ Util::shared_ptr<char> old_content,
+ Util::shared_ptr<char> new_content);
void notifyAttributeChanged(Node &node, GQuark name,
- Util::SharedCStringPtr old_value,
- Util::SharedCStringPtr new_value);
+ Util::shared_ptr<char> old_value,
+ Util::shared_ptr<char> new_value);
private:
unsigned _iterating;
diff --git a/src/xml/event.cpp b/src/xml/event.cpp
index c9f0b50a7..dd7167874 100644
--- a/src/xml/event.cpp
+++ b/src/xml/event.cpp
@@ -114,15 +114,15 @@ public:
}
void notifyAttributeChanged(Node &node, GQuark name,
- Inkscape::Util::SharedCStringPtr old_value,
- Inkscape::Util::SharedCStringPtr new_value)
+ Inkscape::Util::shared_ptr<char> old_value,
+ Inkscape::Util::shared_ptr<char> new_value)
{
node.setAttribute(g_quark_to_string(name), new_value);
}
void notifyContentChanged(Node &node,
- Inkscape::Util::SharedCStringPtr old_value,
- Inkscape::Util::SharedCStringPtr new_value)
+ Inkscape::Util::shared_ptr<char> old_value,
+ Inkscape::Util::shared_ptr<char> new_value)
{
node.setContent(new_value);
}
@@ -458,22 +458,22 @@ public:
}
void notifyAttributeChanged(Node &node, GQuark name,
- Inkscape::Util::SharedCStringPtr old_value,
- Inkscape::Util::SharedCStringPtr new_value)
+ Inkscape::Util::shared_ptr<char> old_value,
+ Inkscape::Util::shared_ptr<char> new_value)
{
if (new_value) {
- g_warning("Event: Set attribute %s to \"%s\" on %s", g_quark_to_string(name), new_value.cString(), node_to_string(node).c_str());
+ g_warning("Event: Set attribute %s to \"%s\" on %s", g_quark_to_string(name), new_value.pointer(), node_to_string(node).c_str());
} else {
g_warning("Event: Unset attribute %s on %s", g_quark_to_string(name), node_to_string(node).c_str());
}
}
void notifyContentChanged(Node &node,
- Inkscape::Util::SharedCStringPtr old_value,
- Inkscape::Util::SharedCStringPtr new_value)
+ Inkscape::Util::shared_ptr<char> old_value,
+ Inkscape::Util::shared_ptr<char> new_value)
{
if (new_value) {
- g_warning("Event: Set content of %s to \"%s\"", node_to_string(node).c_str(), new_value.cString());
+ g_warning("Event: Set content of %s to \"%s\"", node_to_string(node).c_str(), new_value.pointer());
} else {
g_warning("Event: Unset content of %s", node_to_string(node).c_str());
}
diff --git a/src/xml/event.h b/src/xml/event.h
index e4ce8b26a..56fdb8bb6 100644
--- a/src/xml/event.h
+++ b/src/xml/event.h
@@ -6,7 +6,7 @@
#include <glibmm/ustring.h>
#include <iterator>
-#include "util/shared-c-string-ptr.h"
+#include "util/share.h"
#include "util/forward-pointer-iterator.h"
#include "gc-managed.h"
#include "xml/node.h"
@@ -96,15 +96,15 @@ private:
class EventChgAttr : public Event {
public:
EventChgAttr(Node *repr, GQuark k,
- Inkscape::Util::SharedCStringPtr ov,
- Inkscape::Util::SharedCStringPtr nv,
+ Inkscape::Util::shared_ptr<char> ov,
+ Inkscape::Util::shared_ptr<char> nv,
Event *next)
: Event(repr, next), key(k),
oldval(ov), newval(nv) {}
GQuark key;
- Inkscape::Util::SharedCStringPtr oldval;
- Inkscape::Util::SharedCStringPtr newval;
+ Inkscape::Util::shared_ptr<char> oldval;
+ Inkscape::Util::shared_ptr<char> newval;
private:
Event *_optimizeOne();
@@ -115,13 +115,13 @@ private:
class EventChgContent : public Event {
public:
EventChgContent(Node *repr,
- Inkscape::Util::SharedCStringPtr ov,
- Inkscape::Util::SharedCStringPtr nv,
+ Inkscape::Util::shared_ptr<char> ov,
+ Inkscape::Util::shared_ptr<char> nv,
Event *next)
: Event(repr, next), oldval(ov), newval(nv) {}
- Inkscape::Util::SharedCStringPtr oldval;
- Inkscape::Util::SharedCStringPtr newval;
+ Inkscape::Util::shared_ptr<char> oldval;
+ Inkscape::Util::shared_ptr<char> newval;
private:
Event *_optimizeOne();
diff --git a/src/xml/log-builder.cpp b/src/xml/log-builder.cpp
index b3d8db59f..97451075a 100644
--- a/src/xml/log-builder.cpp
+++ b/src/xml/log-builder.cpp
@@ -48,16 +48,16 @@ void LogBuilder::setChildOrder(Node &node, Node &child,
}
void LogBuilder::setContent(Node &node,
- Util::SharedCStringPtr old_content,
- Util::SharedCStringPtr new_content)
+ Util::shared_ptr<char> old_content,
+ Util::shared_ptr<char> new_content)
{
_log = new Inkscape::XML::EventChgContent(&node, old_content, new_content, _log);
_log = _log->optimizeOne();
}
void LogBuilder::setAttribute(Node &node, GQuark name,
- Util::SharedCStringPtr old_value,
- Util::SharedCStringPtr new_value)
+ Util::shared_ptr<char> old_value,
+ Util::shared_ptr<char> new_value)
{
_log = new Inkscape::XML::EventChgAttr(&node, name, old_value, new_value, _log);
_log = _log->optimizeOne();
diff --git a/src/xml/log-builder.h b/src/xml/log-builder.h
index 1f1ea1959..dc68a4f4a 100644
--- a/src/xml/log-builder.h
+++ b/src/xml/log-builder.h
@@ -39,12 +39,12 @@ public:
Node *old_prev, Node *new_prev);
void setContent(Node &node,
- Util::SharedCStringPtr old_content,
- Util::SharedCStringPtr new_content);
+ Util::shared_ptr<char> old_content,
+ Util::shared_ptr<char> new_content);
void setAttribute(Node &node, GQuark name,
- Util::SharedCStringPtr old_value,
- Util::SharedCStringPtr new_value);
+ Util::shared_ptr<char> old_value,
+ Util::shared_ptr<char> new_value);
private:
Event *_log;
diff --git a/src/xml/node-observer.h b/src/xml/node-observer.h
index 4a884b8a9..e50a41dd8 100644
--- a/src/xml/node-observer.h
+++ b/src/xml/node-observer.h
@@ -16,7 +16,7 @@
#define SEEN_INKSCAPE_XML_NODE_OBSERVER_H
#include <glib/gquark.h>
-#include "util/shared-c-string-ptr.h"
+#include "util/share.h"
namespace Inkscape {
namespace XML {
@@ -43,12 +43,12 @@ public:
Node *old_prev, Node *new_prev)=0;
virtual void notifyContentChanged(Node &node,
- Util::SharedCStringPtr old_content,
- Util::SharedCStringPtr new_content)=0;
+ Util::shared_ptr<char> old_content,
+ Util::shared_ptr<char> new_content)=0;
virtual void notifyAttributeChanged(Node &node, GQuark name,
- Util::SharedCStringPtr old_value,
- Util::SharedCStringPtr new_value)=0;
+ Util::shared_ptr<char> old_value,
+ Util::shared_ptr<char> new_value)=0;
};
}
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
index bb62393fc..884bb3360 100644
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
@@ -585,7 +585,7 @@ repr_quote_write (Writer &out, const gchar * val)
namespace {
typedef std::map<Glib::QueryQuark, gchar const *, Inkscape::compare_quark_ids> LocalNameMap;
-typedef std::map<Glib::QueryQuark, Inkscape::Util::SharedCStringPtr, Inkscape::compare_quark_ids> NSMap;
+typedef std::map<Glib::QueryQuark, Inkscape::Util::shared_ptr<char>, Inkscape::compare_quark_ids> NSMap;
gchar const *qname_local_name(Glib::QueryQuark qname) {
static LocalNameMap local_name_map;
@@ -604,7 +604,8 @@ gchar const *qname_local_name(Glib::QueryQuark qname) {
}
void add_ns_map_entry(NSMap &ns_map, Glib::QueryQuark prefix) {
- using Inkscape::Util::SharedCStringPtr;
+ using Inkscape::Util::shared_ptr;
+ using Inkscape::Util::share_unsafe;
static const Glib::QueryQuark xml_prefix("xml");
@@ -613,12 +614,12 @@ void add_ns_map_entry(NSMap &ns_map, Glib::QueryQuark prefix) {
if (prefix.id()) {
gchar const *uri=sp_xml_ns_prefix_uri(g_quark_to_string(prefix));
if (uri) {
- ns_map.insert(NSMap::value_type(prefix, SharedCStringPtr::coerce(uri)));
+ ns_map.insert(NSMap::value_type(prefix, share_unsafe(uri)));
} else if ( prefix != xml_prefix ) {
g_warning("No namespace known for normalized prefix %s", g_quark_to_string(prefix));
}
} else {
- ns_map.insert(NSMap::value_type(prefix, SharedCStringPtr()));
+ ns_map.insert(NSMap::value_type(prefix, shared_ptr<char>()));
}
}
}
@@ -647,7 +648,7 @@ void populate_ns_map(NSMap &ns_map, Node &repr) {
void
sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitespace, gchar const *default_ns)
{
- using Inkscape::Util::SharedCStringPtr;
+ using Inkscape::Util::shared_ptr;
g_assert(repr != NULL);
Glib::QueryQuark xml_prefix=g_quark_from_static_string("xml");
@@ -663,7 +664,7 @@ sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitesp
for ( NSMap::iterator iter=ns_map.begin() ; iter != ns_map.end() ; ++iter )
{
Glib::QueryQuark prefix=(*iter).first;
- SharedCStringPtr ns_uri=(*iter).second;
+ shared_ptr<char> ns_uri=(*iter).second;
if (prefix.id()) {
if ( prefix != xml_prefix ) {
diff --git a/src/xml/repr.cpp b/src/xml/repr.cpp
index 2cd770a52..9612bb858 100644
--- a/src/xml/repr.cpp
+++ b/src/xml/repr.cpp
@@ -28,7 +28,7 @@
#include "xml/comment-node.h"
#include "xml/simple-document.h"
-using Inkscape::Util::SharedCStringPtr;
+using Inkscape::Util::share_string;
/// Returns new node.
Inkscape::XML::Node *
@@ -45,7 +45,7 @@ Inkscape::XML::Node *
sp_repr_new_text(gchar const *content)
{
g_return_val_if_fail(content != NULL, NULL);
- return new Inkscape::XML::TextNode(SharedCStringPtr::copy(content));
+ return new Inkscape::XML::TextNode(share_string(content));
}
/// Returns new commentnode with comment. See Inkscape::XML::CommentNode.
@@ -53,7 +53,7 @@ Inkscape::XML::Node *
sp_repr_new_comment(gchar const *comment)
{
g_return_val_if_fail(comment != NULL, NULL);
- return new Inkscape::XML::CommentNode(SharedCStringPtr::copy(comment));
+ return new Inkscape::XML::CommentNode(share_string(comment));
}
/// Returns new document having as first child a node named rootname.
diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp
index d3e047431..5e21f941e 100644
--- a/src/xml/simple-node.cpp
+++ b/src/xml/simple-node.cpp
@@ -28,7 +28,7 @@ namespace XML {
namespace {
-Util::SharedCStringPtr stringify_node(Node const &node) {
+Util::shared_ptr<char> stringify_node(Node const &node) {
gchar *string;
switch (node.type()) {
case ELEMENT_NODE: {
@@ -51,14 +51,14 @@ Util::SharedCStringPtr stringify_node(Node const &node) {
default:
string = g_strdup_printf("unknown(%p)", &node);
}
- Util::SharedCStringPtr result=Util::SharedCStringPtr::copy(string);
+ Util::shared_ptr<char> result=Util::share_string(string);
g_free(string);
return result;
}
-Util::SharedCStringPtr stringify_unsigned(unsigned n) {
+Util::shared_ptr<char> stringify_unsigned(unsigned n) {
gchar *string = g_strdup_printf("%u", n);
- Util::SharedCStringPtr result=Util::SharedCStringPtr::copy(string);
+ Util::shared_ptr<char> result=Util::share_string(string);
g_free(string);
return result;
}
@@ -75,8 +75,8 @@ public:
static Category category() { return XML; }
- Util::SharedCStringPtr name() const {
- return Util::SharedCStringPtr::coerce("add-child");
+ Util::shared_ptr<char> name() const {
+ return Util::share_static("add-child");
}
unsigned propertyCount() const { return 3; }
PropertyPair property(unsigned i) const {
@@ -92,8 +92,8 @@ public:
}
}
private:
- Util::SharedCStringPtr _parent;
- Util::SharedCStringPtr _child;
+ Util::shared_ptr<char> _parent;
+ Util::shared_ptr<char> _child;
unsigned _position;
};
@@ -106,8 +106,8 @@ public:
static Category category() { return XML; }
- Util::SharedCStringPtr name() const {
- return Util::SharedCStringPtr::coerce("remove-child");
+ Util::shared_ptr<char> name() const {
+ return Util::share_static("remove-child");
}
unsigned propertyCount() const { return 2; }
PropertyPair property(unsigned i) const {
@@ -121,8 +121,8 @@ public:
}
}
private:
- Util::SharedCStringPtr _parent;
- Util::SharedCStringPtr _child;
+ Util::shared_ptr<char> _parent;
+ Util::shared_ptr<char> _child;
};
class DebugSetChildPosition : public Debug::Event {
@@ -140,8 +140,8 @@ public:
static Category category() { return XML; }
- Util::SharedCStringPtr name() const {
- return Util::SharedCStringPtr::coerce("set-child-position");
+ Util::shared_ptr<char> name() const {
+ return Util::share_static("set-child-position");
}
unsigned propertyCount() const { return 3; }
PropertyPair property(unsigned i) const {
@@ -157,25 +157,25 @@ public:
}
}
private:
- Util::SharedCStringPtr _parent;
- Util::SharedCStringPtr _child;
+ Util::shared_ptr<char> _parent;
+ Util::shared_ptr<char> _child;
unsigned _position;
};
class DebugSetContent : public Debug::Event {
public:
DebugSetContent(Node const &node,
- Util::SharedCStringPtr old_content,
- Util::SharedCStringPtr new_content)
+ Util::shared_ptr<char> old_content,
+ Util::shared_ptr<char> new_content)
: _node(stringify_node(node)), _content(new_content) {}
static Category category() { return XML; }
- Util::SharedCStringPtr name() const {
+ Util::shared_ptr<char> name() const {
if (_content) {
- return Util::SharedCStringPtr::coerce("set-content");
+ return Util::share_static("set-content");
} else {
- return Util::SharedCStringPtr::coerce("clear-content");
+ return Util::share_static("clear-content");
}
}
unsigned propertyCount() const {
@@ -196,26 +196,26 @@ public:
}
}
private:
- Util::SharedCStringPtr _node;
- Util::SharedCStringPtr _content;
+ Util::shared_ptr<char> _node;
+ Util::shared_ptr<char> _content;
};
class DebugSetAttribute : public Debug::Event {
public:
DebugSetAttribute(Node const &node, GQuark name,
- Util::SharedCStringPtr old_value,
- Util::SharedCStringPtr new_value)
+ Util::shared_ptr<char> old_value,
+ Util::shared_ptr<char> new_value)
: _node(stringify_node(node)),
- _name(Util::SharedCStringPtr::coerce(g_quark_to_string(name))),
+ _name(Util::share_unsafe(g_quark_to_string(name))),
_value(new_value) {}
static Category category() { return XML; }
- Util::SharedCStringPtr name() const {
+ Util::shared_ptr<char> name() const {
if (_value) {
- return Util::SharedCStringPtr::coerce("set-attribute");
+ return Util::share_static("set-attribute");
} else {
- return Util::SharedCStringPtr::coerce("clear-attribute");
+ return Util::share_static("clear-attribute");
}
}
unsigned propertyCount() const {
@@ -239,12 +239,15 @@ public:
}
private:
- Util::SharedCStringPtr _node;
- Util::SharedCStringPtr _name;
- Util::SharedCStringPtr _value;
+ Util::shared_ptr<char> _node;
+ Util::shared_ptr<char> _name;
+ Util::shared_ptr<char> _value;
};
-using Inkscape::Util::SharedCStringPtr;
+using Inkscape::Util::shared_ptr;
+using Inkscape::Util::share_string;
+using Inkscape::Util::share_unsafe;
+using Inkscape::Util::share_static;
using Inkscape::Util::List;
using Inkscape::Util::MutableList;
using Inkscape::Util::cons;
@@ -363,8 +366,8 @@ bool SimpleNode::matchAttributeName(gchar const *partial_name) const {
}
void SimpleNode::setContent(gchar const *content) {
- SharedCStringPtr old_content=_content;
- SharedCStringPtr new_content = ( content ? SharedCStringPtr::copy(content) : SharedCStringPtr() );
+ shared_ptr<char> old_content=_content;
+ shared_ptr<char> new_content = ( content ? share_string(content) : shared_ptr<char>() );
Debug::EventTracker<DebugSetContent> tracker(
*this, old_content, new_content
@@ -399,11 +402,11 @@ SimpleNode::setAttribute(gchar const *name, gchar const *value, bool const is_in
Debug::EventTracker<> tracker;
- SharedCStringPtr old_value=( existing ? existing->value : SharedCStringPtr() );
+ shared_ptr<char> old_value=( existing ? existing->value : shared_ptr<char>() );
- SharedCStringPtr new_value=SharedCStringPtr();
+ shared_ptr<char> new_value=shared_ptr<char>();
if (value) {
- new_value = SharedCStringPtr::copy(value);
+ new_value = share_string(value);
tracker.set<DebugSetAttribute>(*this, key, old_value, new_value);
if (!existing) {
if (ref) {
@@ -613,11 +616,11 @@ void child_removed(Node *node, Node *child, Node *ref, void *data) {
}
void content_changed(Node *node, gchar const *old_content, gchar const *new_content, void *data) {
- reinterpret_cast<NodeObserver *>(data)->notifyContentChanged(*node, Util::SharedCStringPtr::coerce((const char *)old_content), Util::SharedCStringPtr::coerce((const char *)new_content));
+ reinterpret_cast<NodeObserver *>(data)->notifyContentChanged(*node, Util::share_unsafe((const char *)old_content), Util::share_unsafe((const char *)new_content));
}
void attr_changed(Node *node, gchar const *name, gchar const *old_value, gchar const *new_value, bool is_interactive, void *data) {
- reinterpret_cast<NodeObserver *>(data)->notifyAttributeChanged(*node, g_quark_from_string(name), Util::SharedCStringPtr::coerce((const char *)old_value), Util::SharedCStringPtr::coerce((const char *)new_value));
+ reinterpret_cast<NodeObserver *>(data)->notifyAttributeChanged(*node, g_quark_from_string(name), Util::share_unsafe((const char *)old_value), Util::share_unsafe((const char *)new_value));
}
void order_changed(Node *node, Node *child, Node *old_ref, Node *new_ref, void *data) {
diff --git a/src/xml/simple-node.h b/src/xml/simple-node.h
index 75fe1db07..f1cf78680 100644
--- a/src/xml/simple-node.h
+++ b/src/xml/simple-node.h
@@ -140,7 +140,7 @@ private:
Inkscape::Util::MutableList<AttributeRecord> _attributes;
- Inkscape::Util::SharedCStringPtr _content;
+ Inkscape::Util::shared_ptr<char> _content;
unsigned _child_count;
mutable bool _cached_positions_valid;
diff --git a/src/xml/simple-session.cpp b/src/xml/simple-session.cpp
index 76caf1e54..c8d873fd2 100644
--- a/src/xml/simple-session.cpp
+++ b/src/xml/simple-session.cpp
@@ -52,11 +52,11 @@ Node *SimpleSession::createElementNode(char const *name) {
}
Node *SimpleSession::createTextNode(char const *content) {
- return new TextNode(Util::SharedCStringPtr::copy(content));
+ return new TextNode(Util::share_string(content));
}
Node *SimpleSession::createCommentNode(char const *content) {
- return new CommentNode(Util::SharedCStringPtr::copy(content));
+ return new CommentNode(Util::share_string(content));
}
void SimpleSession::notifyChildAdded(Node &parent,
@@ -88,8 +88,8 @@ void SimpleSession::notifyChildOrderChanged(Node &parent,
}
void SimpleSession::notifyContentChanged(Node &node,
- Util::SharedCStringPtr old_content,
- Util::SharedCStringPtr new_content)
+ Util::shared_ptr<char> old_content,
+ Util::shared_ptr<char> new_content)
{
if (_in_transaction) {
_log_builder.setContent(node, old_content, new_content);
@@ -98,8 +98,8 @@ void SimpleSession::notifyContentChanged(Node &node,
void SimpleSession::notifyAttributeChanged(Node &node,
GQuark name,
- Util::SharedCStringPtr old_value,
- Util::SharedCStringPtr new_value)
+ Util::shared_ptr<char> old_value,
+ Util::shared_ptr<char> new_value)
{
if (_in_transaction) {
_log_builder.setAttribute(node, name, old_value, new_value);
diff --git a/src/xml/simple-session.h b/src/xml/simple-session.h
index 5e9e3a7c1..9e3693d9a 100644
--- a/src/xml/simple-session.h
+++ b/src/xml/simple-session.h
@@ -52,12 +52,12 @@ public:
Inkscape::XML::Node *old_prev, Inkscape::XML::Node *new_prev);
void notifyContentChanged(Inkscape::XML::Node &node,
- Util::SharedCStringPtr old_content,
- Util::SharedCStringPtr new_content);
+ Util::shared_ptr<char> old_content,
+ Util::shared_ptr<char> new_content);
void notifyAttributeChanged(Inkscape::XML::Node &node, GQuark name,
- Util::SharedCStringPtr old_value,
- Util::SharedCStringPtr new_value);
+ Util::shared_ptr<char> old_value,
+ Util::shared_ptr<char> new_value);
private:
SimpleSession(SimpleSession const &); // no copy
diff --git a/src/xml/text-node.h b/src/xml/text-node.h
index c07d70f65..bcd1c3e4f 100644
--- a/src/xml/text-node.h
+++ b/src/xml/text-node.h
@@ -23,7 +23,7 @@ namespace Inkscape {
namespace XML {
struct TextNode : public SimpleNode {
- TextNode(Util::SharedCStringPtr content)
+ TextNode(Util::shared_ptr<char> content)
: SimpleNode(g_quark_from_static_string("string"))
{
setContent(content);