From cb8c36249e983866378e7915e6605ef92d247923 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 23 May 2019 11:06:12 +0300 Subject: 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. --- src/object/sp-guide.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/object/sp-guide.cpp') diff --git a/src/object/sp-guide.cpp b/src/object/sp-guide.cpp index 4fe73ca4e..853511d42 100644 --- a/src/object/sp-guide.cpp +++ b/src/object/sp-guide.cpp @@ -471,7 +471,7 @@ void SPGuide::set_color(const unsigned r, const unsigned g, const unsigned b, bo std::ostringstream os; os << "rgb(" << r << "," << g << "," << b << ")"; //XML Tree being used directly while it shouldn't be - getRepr()->setAttribute("inkscape:color", os.str().c_str()); + setAttribute("inkscape:color", os.str()); } } @@ -483,7 +483,7 @@ void SPGuide::set_locked(const bool locked, bool const commit) } if (commit) { - getRepr()->setAttribute("inkscape:locked", g_strdup(locked ? "true" : "false")); + setAttribute("inkscape:locked", locked ? "true" : "false"); } } @@ -495,7 +495,7 @@ void SPGuide::set_label(const char* label, bool const commit) if (commit) { //XML Tree being used directly while it shouldn't be - getRepr()->setAttribute("inkscape:label", label); + setAttribute("inkscape:label", label); } } -- cgit v1.2.3