summaryrefslogtreecommitdiffstats
path: root/src/object/sp-marker.cpp
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2019-05-23 08:06:12 +0000
committerShlomi Fish <shlomif@shlomifish.org>2019-06-06 12:57:27 +0000
commitcb8c36249e983866378e7915e6605ef92d247923 (patch)
tree53ec0a0745250375aaeb4b5a52f821380ccb614a /src/object/sp-marker.cpp
parentCI: Avoid failure due to sorting issue (diff)
downloadinkscape-cb8c36249e983866378e7915e6605ef92d247923.tar.gz
inkscape-cb8c36249e983866378e7915e6605ef92d247923.zip
Refactoring: call setAttribute() directly.
Call this->setAttribute(...) directly instead of this->getRepr()->setAttribute(...). This avoids clutter and mental indirection. See http://wiki.inkscape.org/wiki/index.php?title=Refactoring_projects&oldid=112116 and https://en.wikipedia.org/wiki/Law_of_Demeter . --- I hereby disclaim any implicit or explicit ownership of my changes in this changeset, and put them under a multiple licence consisting of your choice of one of more of: - The CC0 / Public Domain - https://creativecommons.org/choose/zero/ . - The MIT / Expat license - https://en.wikipedia.org/wiki/MIT_License - The default licence of your project - The https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License - version 2.1 or higher - The https://en.wikipedia.org/wiki/GNU_General_Public_License - version 2 or higher - Any licence in the 2018-Aug-27 popular licenses list of https://opensource.org/licenses - The https://en.wikipedia.org/wiki/Apache_License version 2.0 or later - The https://en.wikipedia.org/wiki/Artistic_License version 2.0 or later - The https://en.wikipedia.org/wiki/ISC_license - The https://opensource.org/licenses/BSD-2-Clause Crediting me will be nice, but not mandatory, and you can change the licence of the project without needing my permission.
Diffstat (limited to 'src/object/sp-marker.cpp')
-rw-r--r--src/object/sp-marker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object/sp-marker.cpp b/src/object/sp-marker.cpp
index 22d06a247..8084dd5f8 100644
--- a/src/object/sp-marker.cpp
+++ b/src/object/sp-marker.cpp
@@ -482,13 +482,13 @@ SPObject *sp_marker_fork_if_necessary(SPObject *marker)
SPDocument *doc = marker->document;
Inkscape::XML::Document *xml_doc = doc->getReprDoc();
// Turn off garbage-collectable or it might be collected before we can use it
- marker->getRepr()->setAttribute("inkscape:collect", nullptr);
+ marker->setAttribute("inkscape:collect", nullptr);
Inkscape::XML::Node *mark_repr = marker->getRepr()->duplicate(xml_doc);
doc->getDefs()->getRepr()->addChild(mark_repr, nullptr);
if (!mark_repr->attribute("inkscape:stockid")) {
mark_repr->setAttribute("inkscape:stockid", mark_repr->attribute("id"));
}
- marker->getRepr()->setAttribute("inkscape:collect", "always");
+ marker->setAttribute("inkscape:collect", "always");
SPObject *marker_new = static_cast<SPObject *>(doc->getObjectByRepr(mark_repr));
Inkscape::GC::release(mark_repr);