diff options
| author | Shlomi Fish <shlomif@shlomifish.org> | 2019-05-23 08:06:12 +0000 |
|---|---|---|
| committer | Shlomi Fish <shlomif@shlomifish.org> | 2019-06-06 12:57:27 +0000 |
| commit | cb8c36249e983866378e7915e6605ef92d247923 (patch) | |
| tree | 53ec0a0745250375aaeb4b5a52f821380ccb614a /src/gradient-chemistry.cpp | |
| parent | CI: Avoid failure due to sorting issue (diff) | |
| download | inkscape-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/gradient-chemistry.cpp')
| -rw-r--r-- | src/gradient-chemistry.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index cde2d45e7..d7b5ccd63 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -380,7 +380,7 @@ SPGradient *sp_gradient_reset_to_userspace(SPGradient *gr, SPItem *item) gr->gradientTransform = squeeze; { gchar *c=sp_svg_transform_write(gr->gradientTransform); - gr->getRepr()->setAttribute("gradientTransform", c); + gr->setAttribute("gradientTransform", c); g_free(c); } } else if (SP_IS_LINEARGRADIENT(gr)) { @@ -509,7 +509,7 @@ SPGradient *sp_gradient_convert_to_userspace(SPGradient *gr, SPItem *item, gchar gr->gradientTransform = skew; { gchar *c=sp_svg_transform_write(gr->gradientTransform); - gr->getRepr()->setAttribute("gradientTransform", c); + gr->setAttribute("gradientTransform", c); g_free(c); } @@ -588,7 +588,7 @@ void sp_gradient_transform_multiply(SPGradient *gradient, Geom::Affine postmul, gradient->gradientTransform_set = TRUE; gchar *c=sp_svg_transform_write(gradient->gradientTransform); - gradient->getRepr()->setAttribute("gradientTransform", c); + gradient->setAttribute("gradientTransform", c); g_free(c); } @@ -685,7 +685,7 @@ SPStop *sp_vector_add_stop(SPGradient *vector, SPStop* prev_stop, SPStop* next_s sp_svg_write_color (c, sizeof(c), cnew); gdouble opacity = (gdouble) SP_RGBA32_A_F (cnew); os << "stop-color:" << c << ";stop-opacity:" << opacity <<";"; - newstop->getRepr()->setAttribute("style", os.str().c_str()); + newstop->setAttribute("style", os.str()); Inkscape::GC::release(new_stop_repr); return newstop; @@ -1230,7 +1230,7 @@ void sp_item_gradient_set_coords(SPItem *item, GrPointType point_type, guint poi gradient->gradientTransform_set = TRUE; if (write_repr) { gchar *s=sp_svg_transform_write(gradient->gradientTransform); - gradient->getRepr()->setAttribute("gradientTransform", s); + gradient->setAttribute("gradientTransform", s); g_free(s); } else { gradient->requestModified(SP_OBJECT_MODIFIED_FLAG); |
