diff options
| author | Martin Owens <doctormo@gmail.com> | 2019-03-20 18:07:04 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2019-03-20 18:07:04 +0000 |
| commit | 3248c4cf747dc0c3e733c062375ae97b2a4e9e47 (patch) | |
| tree | 8d2802ee94cff4590f179da7214e098e7095c3be /src/xml/simple-node.cpp | |
| parent | Disable GTK3's motion event compression which was making drawing lag. (diff) | |
| parent | Add explicit overrides (diff) | |
| download | inkscape-3248c4cf747dc0c3e733c062375ae97b2a4e9e47.tar.gz inkscape-3248c4cf747dc0c3e733c062375ae97b2a4e9e47.zip | |
Fix #116: Wrong element names shown in XML editor for circles and ellipses
Diffstat (limited to 'src/xml/simple-node.cpp')
| -rw-r--r-- | src/xml/simple-node.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp index 8996bd990..a1f0c7024 100644 --- a/src/xml/simple-node.cpp +++ b/src/xml/simple-node.cpp @@ -149,6 +149,15 @@ public: } }; +class DebugSetElementName : public DebugXMLNode { +public: + DebugSetElementName(Node const& node, GQuark name) + : DebugXMLNode(node, "set-name") + { + _addProperty("name", g_quark_to_string(name)); + } +}; + } using Util::ptr_shared; @@ -399,6 +408,21 @@ SimpleNode::setAttribute(gchar const *name, gchar const *value, bool const /*is_ g_free( cleaned_value ); } +void SimpleNode::setCodeUnsafe(int code) { + GQuark old_code = static_cast<GQuark>(_name); + GQuark new_code = static_cast<GQuark>(code); + + Debug::EventTracker<> tracker; + tracker.set<DebugSetElementName>(*this, new_code); + + _name = static_cast<int>(new_code); + + if (new_code != old_code) { + _document->logger()->notifyElementNameChanged(*this, old_code, new_code); + _observers.notifyElementNameChanged(*this, old_code, new_code); + } +} + void SimpleNode::addChild(Node *generic_child, Node *generic_ref) { g_assert(generic_child); g_assert(generic_child->document() == _document); |
