diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-03 00:10:02 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-03 00:10:02 +0000 |
| commit | d2df0412f728dd5bb54537dfdfe7c35b34d40e0e (patch) | |
| tree | e2703384779e83312c456399999997fcc289c5cf /src/xml | |
| parent | Merge branch 'master' into powerpencil (diff) | |
| parent | change assignment to equality (diff) | |
| download | inkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.tar.gz inkscape-d2df0412f728dd5bb54537dfdfe7c35b34d40e0e.zip | |
Merge branch 'master' into powerpencil
Diffstat (limited to 'src/xml')
| -rw-r--r-- | src/xml/attribute-record.h | 4 | ||||
| -rw-r--r-- | src/xml/comment-node.h | 2 | ||||
| -rw-r--r-- | src/xml/composite-node-observer.cpp | 8 | ||||
| -rw-r--r-- | src/xml/composite-node-observer.h | 8 | ||||
| -rw-r--r-- | src/xml/event.cpp | 16 | ||||
| -rw-r--r-- | src/xml/event.h | 16 | ||||
| -rw-r--r-- | src/xml/helper-observer.cpp | 4 | ||||
| -rw-r--r-- | src/xml/helper-observer.h | 4 | ||||
| -rw-r--r-- | src/xml/log-builder.cpp | 8 | ||||
| -rw-r--r-- | src/xml/log-builder.h | 8 | ||||
| -rw-r--r-- | src/xml/makefile.in | 17 | ||||
| -rw-r--r-- | src/xml/node-observer.h | 8 | ||||
| -rw-r--r-- | src/xml/pi-node.h | 2 | ||||
| -rw-r--r-- | src/xml/rebase-hrefs.cpp | 4 | ||||
| -rw-r--r-- | src/xml/repr-io.cpp | 70 | ||||
| -rw-r--r-- | src/xml/simple-document.cpp | 8 | ||||
| -rw-r--r-- | src/xml/simple-document.h | 8 | ||||
| -rw-r--r-- | src/xml/simple-node.cpp | 18 | ||||
| -rw-r--r-- | src/xml/simple-node.h | 2 | ||||
| -rw-r--r-- | src/xml/text-node.h | 4 |
20 files changed, 93 insertions, 126 deletions
diff --git a/src/xml/attribute-record.h b/src/xml/attribute-record.h index 7caeab6b6..91118c8a0 100644 --- a/src/xml/attribute-record.h +++ b/src/xml/attribute-record.h @@ -22,13 +22,13 @@ namespace XML { * represented by this structure. */ struct AttributeRecord : public Inkscape::GC::Managed<> { - AttributeRecord(GQuark k, Inkscape::Util::ptr_shared<char> v) + AttributeRecord(GQuark k, Inkscape::Util::ptr_shared v) : key(k), value(v) {} /** @brief GQuark corresponding to the name of the attribute */ GQuark key; /** @brief Shared pointer to the value of the attribute */ - Inkscape::Util::ptr_shared<char> value; + Inkscape::Util::ptr_shared value; // accept default copy constructor and assignment operator }; diff --git a/src/xml/comment-node.h b/src/xml/comment-node.h index 56b8ad476..7c37a0d24 100644 --- a/src/xml/comment-node.h +++ b/src/xml/comment-node.h @@ -26,7 +26,7 @@ namespace XML { * @brief Comment node, e.g. <!-- Some comment --> */ struct CommentNode : public SimpleNode { - CommentNode(Util::ptr_shared<char> content, Document *doc) + CommentNode(Util::ptr_shared content, Document *doc) : SimpleNode(g_quark_from_static_string("comment"), doc) { setContent(content); diff --git a/src/xml/composite-node-observer.cpp b/src/xml/composite-node-observer.cpp index 7343ab1a8..581a4c226 100644 --- a/src/xml/composite-node-observer.cpp +++ b/src/xml/composite-node-observer.cpp @@ -69,7 +69,7 @@ void CompositeNodeObserver::notifyChildOrderChanged(Node &node, Node &child, void CompositeNodeObserver::notifyContentChanged( Node &node, - Util::ptr_shared<char> old_content, Util::ptr_shared<char> new_content + Util::ptr_shared old_content, Util::ptr_shared new_content ) { _startIteration(); for ( ObserverRecordList::iterator iter=_active.begin() ; @@ -84,7 +84,7 @@ void CompositeNodeObserver::notifyContentChanged( void CompositeNodeObserver::notifyAttributeChanged( Node &node, GQuark name, - Util::ptr_shared<char> old_value, Util::ptr_shared<char> new_value + Util::ptr_shared old_value, Util::ptr_shared new_value ) { _startIteration(); for ( ObserverRecordList::iterator iter=_active.begin() ; @@ -133,13 +133,13 @@ public: } } - void notifyContentChanged(Node &node, Util::ptr_shared<char> old_content, Util::ptr_shared<char> new_content) { + void notifyContentChanged(Node &node, Util::ptr_shared old_content, Util::ptr_shared new_content) { if (vector.content_changed) { vector.content_changed(&node, old_content, new_content, data); } } - void notifyAttributeChanged(Node &node, GQuark name, Util::ptr_shared<char> old_value, Util::ptr_shared<char> new_value) { + void notifyAttributeChanged(Node &node, GQuark name, Util::ptr_shared old_value, Util::ptr_shared 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 6e93a57da..1004617bf 100644 --- a/src/xml/composite-node-observer.h +++ b/src/xml/composite-node-observer.h @@ -75,12 +75,12 @@ public: Node *old_prev, Node *new_prev); void notifyContentChanged(Node &node, - Util::ptr_shared<char> old_content, - Util::ptr_shared<char> new_content); + Util::ptr_shared old_content, + Util::ptr_shared new_content); void notifyAttributeChanged(Node &node, GQuark name, - Util::ptr_shared<char> old_value, - Util::ptr_shared<char> new_value); + Util::ptr_shared old_value, + Util::ptr_shared new_value); private: unsigned _iterating; diff --git a/src/xml/event.cpp b/src/xml/event.cpp index 9a760ccc5..54f55d5c3 100644 --- a/src/xml/event.cpp +++ b/src/xml/event.cpp @@ -107,15 +107,15 @@ public: } void notifyAttributeChanged(Node &node, GQuark name, - Inkscape::Util::ptr_shared<char> /*old_value*/, - Inkscape::Util::ptr_shared<char> new_value) + Inkscape::Util::ptr_shared /*old_value*/, + Inkscape::Util::ptr_shared new_value) { node.setAttribute(g_quark_to_string(name), new_value); } void notifyContentChanged(Node &node, - Inkscape::Util::ptr_shared<char> /*old_value*/, - Inkscape::Util::ptr_shared<char> new_value) + Inkscape::Util::ptr_shared /*old_value*/, + Inkscape::Util::ptr_shared new_value) { node.setContent(new_value); } @@ -461,8 +461,8 @@ public: } void notifyAttributeChanged(Node &node, GQuark name, - Inkscape::Util::ptr_shared<char> /*old_value*/, - Inkscape::Util::ptr_shared<char> new_value) + Inkscape::Util::ptr_shared /*old_value*/, + Inkscape::Util::ptr_shared new_value) { if (new_value) { g_warning("Event: Set attribute %s to \"%s\" on %s", g_quark_to_string(name), new_value.pointer(), node_to_string(node).c_str()); @@ -472,8 +472,8 @@ public: } void notifyContentChanged(Node &node, - Inkscape::Util::ptr_shared<char> /*old_value*/, - Inkscape::Util::ptr_shared<char> new_value) + Inkscape::Util::ptr_shared /*old_value*/, + Inkscape::Util::ptr_shared new_value) { if (new_value) { g_warning("Event: Set content of %s to \"%s\"", node_to_string(node).c_str(), new_value.pointer()); diff --git a/src/xml/event.h b/src/xml/event.h index f6b734c29..ca79983ba 100644 --- a/src/xml/event.h +++ b/src/xml/event.h @@ -167,8 +167,8 @@ private: class EventChgAttr : public Event { public: EventChgAttr(Node *repr, GQuark k, - Inkscape::Util::ptr_shared<char> ov, - Inkscape::Util::ptr_shared<char> nv, + Inkscape::Util::ptr_shared ov, + Inkscape::Util::ptr_shared nv, Event *next) : Event(repr, next), key(k), oldval(ov), newval(nv) {} @@ -176,9 +176,9 @@ public: /// GQuark corresponding to the changed attribute's name GQuark key; /// Value of the attribute before the change - Inkscape::Util::ptr_shared<char> oldval; + Inkscape::Util::ptr_shared oldval; /// Value of the attribute after the change - Inkscape::Util::ptr_shared<char> newval; + Inkscape::Util::ptr_shared newval; private: Event *_optimizeOne(); @@ -192,15 +192,15 @@ private: class EventChgContent : public Event { public: EventChgContent(Node *repr, - Inkscape::Util::ptr_shared<char> ov, - Inkscape::Util::ptr_shared<char> nv, + Inkscape::Util::ptr_shared ov, + Inkscape::Util::ptr_shared nv, Event *next) : Event(repr, next), oldval(ov), newval(nv) {} /// Content of the node before the change - Inkscape::Util::ptr_shared<char> oldval; + Inkscape::Util::ptr_shared oldval; /// Content of the node after the change - Inkscape::Util::ptr_shared<char> newval; + Inkscape::Util::ptr_shared newval; private: Event *_optimizeOne(); diff --git a/src/xml/helper-observer.cpp b/src/xml/helper-observer.cpp index 957f3df0a..6f1094e53 100644 --- a/src/xml/helper-observer.cpp +++ b/src/xml/helper-observer.cpp @@ -44,10 +44,10 @@ void SignalObserver::notifyChildRemoved(XML::Node&, XML::Node&, XML::Node*) void SignalObserver::notifyChildOrderChanged(XML::Node&, XML::Node&, XML::Node*, XML::Node*) { signal_changed()(); } -void SignalObserver::notifyContentChanged(XML::Node&, Util::ptr_shared<char>, Util::ptr_shared<char>) +void SignalObserver::notifyContentChanged(XML::Node&, Util::ptr_shared, Util::ptr_shared) {} -void SignalObserver::notifyAttributeChanged(XML::Node&, GQuark, Util::ptr_shared<char>, Util::ptr_shared<char>) +void SignalObserver::notifyAttributeChanged(XML::Node&, GQuark, Util::ptr_shared, Util::ptr_shared) { signal_changed()(); } sigc::signal<void>& SignalObserver::signal_changed() diff --git a/src/xml/helper-observer.h b/src/xml/helper-observer.h index b4c0aba41..b06b61e9c 100644 --- a/src/xml/helper-observer.h +++ b/src/xml/helper-observer.h @@ -24,8 +24,8 @@ public: void notifyChildAdded(Node&, Node&, Node*); void notifyChildRemoved(Node&, Node&, Node*); void notifyChildOrderChanged(Node&, Node&, Node*, Node*); - void notifyContentChanged(Node&, Util::ptr_shared<char>, Util::ptr_shared<char>); - void notifyAttributeChanged(Node&, GQuark, Util::ptr_shared<char>, Util::ptr_shared<char>); + void notifyContentChanged(Node&, Util::ptr_shared, Util::ptr_shared); + void notifyAttributeChanged(Node&, GQuark, Util::ptr_shared, Util::ptr_shared); sigc::signal<void>& signal_changed(); private: sigc::signal<void> _signal_changed; diff --git a/src/xml/log-builder.cpp b/src/xml/log-builder.cpp index 2cbdcfacf..12577cf69 100644 --- a/src/xml/log-builder.cpp +++ b/src/xml/log-builder.cpp @@ -49,16 +49,16 @@ void LogBuilder::setChildOrder(Node &node, Node &child, } void LogBuilder::setContent(Node &node, - Util::ptr_shared<char> old_content, - Util::ptr_shared<char> new_content) + Util::ptr_shared old_content, + Util::ptr_shared new_content) { _log = new Inkscape::XML::EventChgContent(&node, old_content, new_content, _log); _log = _log->optimizeOne(); } void LogBuilder::setAttribute(Node &node, GQuark name, - Util::ptr_shared<char> old_value, - Util::ptr_shared<char> new_value) + Util::ptr_shared old_value, + Util::ptr_shared 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 e94dd1daa..8b0f6662d 100644 --- a/src/xml/log-builder.h +++ b/src/xml/log-builder.h @@ -58,12 +58,12 @@ public: Node *old_prev, Node *new_prev); void setContent(Node &node, - Util::ptr_shared<char> old_content, - Util::ptr_shared<char> new_content); + Util::ptr_shared old_content, + Util::ptr_shared new_content); void setAttribute(Node &node, GQuark name, - Util::ptr_shared<char> old_value, - Util::ptr_shared<char> new_value); + Util::ptr_shared old_value, + Util::ptr_shared new_value); /*@}*/ private: diff --git a/src/xml/makefile.in b/src/xml/makefile.in deleted file mode 100644 index 376b4c218..000000000 --- a/src/xml/makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - -@SET_MAKE@ - -OBJEXT = @OBJEXT@ - -# Explicit so that it's the default rule. -all: - cd .. && $(MAKE) xml/all - -clean %.a %.$(OBJEXT): - cd .. && $(MAKE) xml/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) diff --git a/src/xml/node-observer.h b/src/xml/node-observer.h index 9c7e096e5..28c492d66 100644 --- a/src/xml/node-observer.h +++ b/src/xml/node-observer.h @@ -123,8 +123,8 @@ public: * @param new_content New content of @c node */ virtual void notifyContentChanged(Node &node, - Util::ptr_shared<char> old_content, - Util::ptr_shared<char> new_content) { + Util::ptr_shared old_content, + Util::ptr_shared new_content) { INK_UNUSED(node); INK_UNUSED(old_content); INK_UNUSED(new_content); @@ -141,8 +141,8 @@ public: * @param new_value New value of the modified attribute */ virtual void notifyAttributeChanged(Node &node, GQuark name, - Util::ptr_shared<char> old_value, - Util::ptr_shared<char> new_value) { + Util::ptr_shared old_value, + Util::ptr_shared new_value) { INK_UNUSED(node); INK_UNUSED(name); INK_UNUSED(old_value); diff --git a/src/xml/pi-node.h b/src/xml/pi-node.h index 76a3dc741..eeed1632d 100644 --- a/src/xml/pi-node.h +++ b/src/xml/pi-node.h @@ -24,7 +24,7 @@ namespace XML { * @brief Processing instruction node, e.g. <?xml version="1.0" encoding="utf-8" standalone="no"?> */ struct PINode : public SimpleNode { - PINode(GQuark target, Util::ptr_shared<char> content, Document *doc) + PINode(GQuark target, Util::ptr_shared content, Document *doc) : SimpleNode(target, doc) { setContent(content); diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp index a34df09a5..c023dc670 100644 --- a/src/xml/rebase-hrefs.cpp +++ b/src/xml/rebase-hrefs.cpp @@ -112,8 +112,8 @@ Inkscape::XML::rebase_href_attrs(gchar const *const old_abs_base, * * However, if we find that xlink:href doesn't need rebasing, then return immediately * with no change to attributes. */ - ptr_shared<char> old_href; - ptr_shared<char> sp_absref; + ptr_shared old_href; + ptr_shared sp_absref; List<AttributeRecord const> ret; { for (List<AttributeRecord const> ai(attributes); ai; ++ai) { diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index d8e0f5418..2ff9d4776 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -67,11 +67,6 @@ static void sp_repr_write_stream_element(Node *repr, Writer &out, gchar const *old_href_abs_base, gchar const *new_href_abs_base); -#ifdef HAVE_LIBWMF -static xmlDocPtr sp_wmf_convert (const char * file_name); -static char * sp_wmf_image_name (void * context); -#endif /* HAVE_LIBWMF */ - class XmlSource { @@ -323,19 +318,18 @@ int XmlSource::close() } /** - * Reads XML from a file, including WMF files, and returns the Document. + * Reads XML from a file, and returns the Document. * The default namespace can also be specified, if desired. */ Document *sp_repr_read_file (const gchar * filename, const gchar *default_ns) { - // g_warning( "Reading file: %s", filename ); xmlDocPtr doc = 0; Document * rdoc = 0; xmlSubstituteEntitiesDefault(1); - g_return_val_if_fail (filename != NULL, NULL); - if (!Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )) { + g_return_val_if_fail(filename != NULL, NULL); + if (!Inkscape::IO::file_test(filename, G_FILE_TEST_EXISTS)) { g_warning("Can't open file: %s (doesn't exist)", filename); return NULL; } @@ -348,45 +342,32 @@ Document *sp_repr_read_file (const gchar * filename, const gchar *default_ns) gsize bytesWritten = 0; GError* error = NULL; // TODO: need to replace with our own fopen and reading - gchar* localFilename = g_filename_from_utf8 ( filename, - -1, &bytesRead, &bytesWritten, &error); - g_return_val_if_fail( localFilename != NULL, NULL ); - - Inkscape::IO::dump_fopen_call( filename, "N" ); + gchar* localFilename = g_filename_from_utf8(filename, -1, &bytesRead, &bytesWritten, &error); + g_return_val_if_fail(localFilename != NULL, NULL); -#ifdef HAVE_LIBWMF - if (strlen (localFilename) > 4) { - if ( (strcmp (localFilename + strlen (localFilename) - 4,".wmf") == 0) - || (strcmp (localFilename + strlen (localFilename) - 4,".WMF") == 0)) { - doc = sp_wmf_convert (localFilename); - } - } -#endif // !HAVE_LIBWMF + Inkscape::IO::dump_fopen_call(filename, "N"); - if ( !doc ) { - XmlSource src; + XmlSource src; - if ( (src.setFile(filename) == 0) ) { + if (src.setFile(filename) == 0) { + doc = src.readXml(); + rdoc = sp_repr_do_read(doc, default_ns); + // For some reason, failed ns loading results in this + // We try a system check version of load with NOENT for adobe + if (rdoc && strcmp(rdoc->root()->name(), "ns:svg") == 0) { + xmlFreeDoc(doc); + src.setFile(filename, true); doc = src.readXml(); - rdoc = sp_repr_do_read( doc, default_ns ); - // For some reason, failed ns loading results in this - // We try a system check version of load with NOENT for adobe - if(rdoc && strcmp(rdoc->root()->name(), "ns:svg") == 0) { - xmlFreeDoc( doc ); - src.setFile(filename, true); - doc = src.readXml(); - rdoc = sp_repr_do_read( doc, default_ns ); - } + rdoc = sp_repr_do_read(doc, default_ns); } } - - if ( doc ) { - xmlFreeDoc( doc ); + if (doc) { + xmlFreeDoc(doc); } - if ( localFilename ) { - g_free( localFilename ); + if (localFilename) { + g_free(localFilename); } return rdoc; @@ -580,7 +561,10 @@ static Node *sp_repr_svg_read_node (Document *xml_doc, xmlNodePtr node, const gc return NULL; // empty text node } - bool preserve = (xmlNodeGetSpacePreserve (node) == 1); + // Since libxml2 2.9.0, only element nodes are checked, thus check parent. + // Note: this only handles XML's rules for white space. SVG's specific rules + // are handled in sp-string.cpp. + bool preserve = (xmlNodeGetSpacePreserve (node->parent) == 1); xmlChar *p; for (p = node->content; *p && g_ascii_isspace (*p) && !preserve; p++) @@ -812,7 +796,7 @@ static void repr_write_comment( Writer &out, const gchar * val, bool addWhitespa namespace { typedef std::map<Glib::QueryQuark, gchar const *, Inkscape::compare_quark_ids> LocalNameMap; -typedef std::map<Glib::QueryQuark, Inkscape::Util::ptr_shared<char>, Inkscape::compare_quark_ids> NSMap; +typedef std::map<Glib::QueryQuark, Inkscape::Util::ptr_shared, Inkscape::compare_quark_ids> NSMap; gchar const *qname_local_name(Glib::QueryQuark qname) { static LocalNameMap local_name_map; @@ -846,7 +830,7 @@ void add_ns_map_entry(NSMap &ns_map, Glib::QueryQuark prefix) { g_warning("No namespace known for normalized prefix %s", g_quark_to_string(prefix)); } } else { - ns_map.insert(NSMap::value_type(prefix, ptr_shared<char>())); + ns_map.insert(NSMap::value_type(prefix, ptr_shared())); } } } @@ -905,7 +889,7 @@ static void sp_repr_write_stream_root_element(Node *repr, Writer &out, for ( NSMap::iterator iter=ns_map.begin() ; iter != ns_map.end() ; ++iter ) { Glib::QueryQuark prefix=(*iter).first; - ptr_shared<char> ns_uri=(*iter).second; + ptr_shared ns_uri=(*iter).second; if (prefix.id()) { if ( prefix != xml_prefix ) { diff --git a/src/xml/simple-document.cpp b/src/xml/simple-document.cpp index bae28e4b4..cf7851897 100644 --- a/src/xml/simple-document.cpp +++ b/src/xml/simple-document.cpp @@ -100,8 +100,8 @@ void SimpleDocument::notifyChildOrderChanged(Node &parent, } void SimpleDocument::notifyContentChanged(Node &node, - Util::ptr_shared<char> old_content, - Util::ptr_shared<char> new_content) + Util::ptr_shared old_content, + Util::ptr_shared new_content) { if (_in_transaction) { _log_builder.setContent(node, old_content, new_content); @@ -110,8 +110,8 @@ void SimpleDocument::notifyContentChanged(Node &node, void SimpleDocument::notifyAttributeChanged(Node &node, GQuark name, - Util::ptr_shared<char> old_value, - Util::ptr_shared<char> new_value) + Util::ptr_shared old_value, + Util::ptr_shared new_value) { if (_in_transaction) { _log_builder.setAttribute(node, name, old_value, new_value); diff --git a/src/xml/simple-document.h b/src/xml/simple-document.h index 7cbe50dda..01933076f 100644 --- a/src/xml/simple-document.h +++ b/src/xml/simple-document.h @@ -56,12 +56,12 @@ public: Node *old_prev, Node *new_prev); void notifyContentChanged(Node &node, - Util::ptr_shared<char> old_content, - Util::ptr_shared<char> new_content); + Util::ptr_shared old_content, + Util::ptr_shared new_content); void notifyAttributeChanged(Node &node, GQuark name, - Util::ptr_shared<char> old_value, - Util::ptr_shared<char> new_value); + Util::ptr_shared old_value, + Util::ptr_shared new_value); protected: SimpleDocument(SimpleDocument const &doc) diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp index 6bd47fd22..78fc52a27 100644 --- a/src/xml/simple-node.cpp +++ b/src/xml/simple-node.cpp @@ -36,7 +36,7 @@ namespace XML { namespace { -Util::ptr_shared<char> stringify_node(Node const &node) { +Util::ptr_shared stringify_node(Node const &node) { gchar *string; switch (node.type()) { case ELEMENT_NODE: { @@ -59,7 +59,7 @@ Util::ptr_shared<char> stringify_node(Node const &node) { default: string = g_strdup_printf("unknown(%p)", &node); } - Util::ptr_shared<char> result=Util::share_string(string); + Util::ptr_shared result=Util::share_string(string); g_free(string); return result; } @@ -68,7 +68,7 @@ typedef Debug::SimpleEvent<Debug::Event::XML> DebugXML; class DebugXMLNode : public DebugXML { public: - DebugXMLNode(Node const &node, Util::ptr_shared<char> name) + DebugXMLNode(Node const &node, Util::ptr_shared name) : DebugXML(name) { _addProperty("node", stringify_node(node)); @@ -115,7 +115,7 @@ public: class DebugSetContent : public DebugXMLNode { public: DebugSetContent(Node const &node, - Util::ptr_shared<char> content) + Util::ptr_shared content) : DebugXMLNode(node, Util::share_static_string("set-content")) { _addProperty("content", content); @@ -133,7 +133,7 @@ class DebugSetAttribute : public DebugXMLNode { public: DebugSetAttribute(Node const &node, GQuark name, - Util::ptr_shared<char> value) + Util::ptr_shared value) : DebugXMLNode(node, Util::share_static_string("set-attribute")) { _addProperty("name", Util::share_static_string(g_quark_to_string(name))); @@ -290,8 +290,8 @@ void SimpleNode::_setParent(SimpleNode *parent) { } void SimpleNode::setContent(gchar const *content) { - ptr_shared<char> old_content=_content; - ptr_shared<char> new_content = ( content ? share_string(content) : ptr_shared<char>() ); + ptr_shared old_content=_content; + ptr_shared new_content = ( content ? share_string(content) : ptr_shared() ); Debug::EventTracker<> tracker; if (new_content) { @@ -365,9 +365,9 @@ SimpleNode::setAttribute(gchar const *name, gchar const *value, bool const /*is_ } Debug::EventTracker<> tracker; - ptr_shared<char> old_value=( existing ? existing->value : ptr_shared<char>() ); + ptr_shared old_value=( existing ? existing->value : ptr_shared() ); - ptr_shared<char> new_value=ptr_shared<char>(); + ptr_shared new_value=ptr_shared(); if (cleaned_value) { new_value = share_string(cleaned_value); tracker.set<DebugSetAttribute>(*this, key, new_value); diff --git a/src/xml/simple-node.h b/src/xml/simple-node.h index d09392249..f2cfa953c 100644 --- a/src/xml/simple-node.h +++ b/src/xml/simple-node.h @@ -144,7 +144,7 @@ private: Inkscape::Util::MutableList<AttributeRecord> _attributes; - Inkscape::Util::ptr_shared<char> _content; + Inkscape::Util::ptr_shared _content; unsigned _child_count; mutable bool _cached_positions_valid; diff --git a/src/xml/text-node.h b/src/xml/text-node.h index 53798b822..4d71203a5 100644 --- a/src/xml/text-node.h +++ b/src/xml/text-node.h @@ -26,13 +26,13 @@ namespace XML { * @brief Text node, e.g. "Some text" in <group>Some text</group> */ struct TextNode : public SimpleNode { - TextNode(Util::ptr_shared<char> content, Document *doc) + TextNode(Util::ptr_shared content, Document *doc) : SimpleNode(g_quark_from_static_string("string"), doc) { setContent(content); _is_CData = false; } - TextNode(Util::ptr_shared<char> content, Document *doc, bool is_CData) + TextNode(Util::ptr_shared content, Document *doc, bool is_CData) : SimpleNode(g_quark_from_static_string("string"), doc) { setContent(content); |
