summaryrefslogtreecommitdiffstats
path: root/src/text-chemistry.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/text-chemistry.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/text-chemistry.cpp')
-rw-r--r--src/text-chemistry.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index 802f10a3f..aacc686da 100644
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
@@ -136,7 +136,7 @@ text_put_on_path()
// remove transform from text, but recursively scale text's fontsize by the expansion
SP_TEXT(text)->_adjustFontsizeRecursive (text, text->transform.descrim());
- text->getRepr()->setAttribute("transform", nullptr);
+ text->setAttribute("transform", nullptr);
// make a list of text children
std::vector<Inkscape::XML::Node *> text_reprs;
@@ -173,8 +173,8 @@ text_put_on_path()
}
// x/y are useless with textpath, and confuse Batik 1.5
- text->getRepr()->setAttribute("x", nullptr);
- text->getRepr()->setAttribute("y", nullptr);
+ text->setAttribute("x", nullptr);
+ text->setAttribute("y", nullptr);
DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Put text on path"));
@@ -219,9 +219,9 @@ text_remove_from_path()
static void
text_remove_all_kerns_recursively(SPObject *o)
{
- o->getRepr()->setAttribute("dx", nullptr);
- o->getRepr()->setAttribute("dy", nullptr);
- o->getRepr()->setAttribute("rotate", nullptr);
+ o->setAttribute("dx", nullptr);
+ o->setAttribute("dy", nullptr);
+ o->setAttribute("rotate", nullptr);
// if x contains a list, leave only the first value
gchar const *x = o->getRepr()->attribute("x");
@@ -229,9 +229,9 @@ text_remove_all_kerns_recursively(SPObject *o)
gchar **xa_space = g_strsplit(x, " ", 0);
gchar **xa_comma = g_strsplit(x, ",", 0);
if (xa_space && *xa_space && *(xa_space + 1)) {
- o->getRepr()->setAttribute("x", *xa_space);
+ o->setAttribute("x", *xa_space);
} else if (xa_comma && *xa_comma && *(xa_comma + 1)) {
- o->getRepr()->setAttribute("x", *xa_comma);
+ o->setAttribute("x", *xa_comma);
}
g_strfreev(xa_space);
g_strfreev(xa_comma);
@@ -338,7 +338,7 @@ text_flow_into_shape()
// remove transform from text, but recursively scale text's fontsize by the expansion
auto ex = i2i_affine(text, shape->parent).descrim();
SP_TEXT(text)->_adjustFontsizeRecursive(text, ex);
- text->getRepr()->setAttribute("transform", nullptr);
+ text->setAttribute("transform", nullptr);
}
Inkscape::XML::Node *root_repr = xml_doc->createElement("svg:flowRoot");