summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/freehand-base.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-12-26 18:49:12 +0000
committertavmjong-free <tavmjong@free.fr>2014-12-26 18:49:12 +0000
commit74f6d0cf39c974ca1980a7be7742f2154d2025f2 (patch)
treef98b503be33ccc32c1074c5c670a0cd9b5fb5332 /src/ui/tools/freehand-base.cpp
parentDocumentation. Fix for bug #1405653 (Outdated links in hacking doc). (diff)
parentSPStyle ref counting clean up. (diff)
downloadinkscape-74f6d0cf39c974ca1980a7be7742f2154d2025f2.tar.gz
inkscape-74f6d0cf39c974ca1980a7be7742f2154d2025f2.zip
Replace sp_style_xxx functions with SPStyle member functions.
Fix a bunch of memory leaks. One leak still remaining in Layout::appendText. (bzr r13824)
Diffstat (limited to 'src/ui/tools/freehand-base.cpp')
-rw-r--r--src/ui/tools/freehand-base.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index c9fe37135..0f14d7534 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -247,11 +247,9 @@ static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points
char const *style_str = NULL;
style_str = repr->attribute("style");
if (style_str) {
- SPStyle *style = sp_style_new(SP_ACTIVE_DOCUMENT);
- sp_style_merge_from_style_string(style, style_str);
- stroke_width = style->stroke_width.computed;
- style->stroke_width.computed = 0;
- sp_style_unref(style);
+ SPStyle style(SP_ACTIVE_DOCUMENT);
+ style.mergeString(style_str);
+ stroke_width = style.stroke_width.computed;
}
std::ostringstream s;
@@ -821,14 +819,11 @@ void spdc_create_single_dot(ToolBase *ec, Geom::Point const &pt, char const *too
// find out stroke width (TODO: is there an easier way??)
double stroke_width = 3.0;
- gchar const *style_str = NULL;
- style_str = repr->attribute("style");
+ gchar const *style_str = repr->attribute("style");
if (style_str) {
- SPStyle *style = sp_style_new(SP_ACTIVE_DOCUMENT);
- sp_style_merge_from_style_string(style, style_str);
- stroke_width = style->stroke_width.computed;
- style->stroke_width.computed = 0;
- sp_style_unref(style);
+ SPStyle style(SP_ACTIVE_DOCUMENT);
+ style.mergeString(style_str);
+ stroke_width = style.stroke_width.computed;
}
// unset stroke and set fill color to former stroke color