summaryrefslogtreecommitdiffstats
path: root/src/style.cpp
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2006-03-31 05:50:28 +0000
committerpjrm <pjrm@users.sourceforge.net>2006-03-31 05:50:28 +0000
commit08612b4442cbb0929080b96db35a12072a7d0c02 (patch)
tree5c71f5ffd180200fd05a3f965e67cc70c91d8328 /src/style.cpp
parentDisallow none/currentColor/uri as values for the `color' property, and get ri... (diff)
downloadinkscape-08612b4442cbb0929080b96db35a12072a7d0c02.tar.gz
inkscape-08612b4442cbb0929080b96db35a12072a7d0c02.zip
cleanup: (sp_style_paint_clear): All callers were passing hunref=TRUE, unset=FALSE, so simplify by getting rid of those parameters.
(bzr r379)
Diffstat (limited to 'src/style.cpp')
-rw-r--r--src/style.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/style.cpp b/src/style.cpp
index 54c3a0c0c..c826c2831 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -148,7 +148,7 @@ static gint sp_style_write_itextdecoration(gchar *p, gint const len, gchar const
static void css2_unescape_unquote(SPIString *val);
-static void sp_style_paint_clear(SPStyle *style, SPIPaint *paint, unsigned hunref, unsigned unset);
+static void sp_style_paint_clear(SPStyle *style, SPIPaint *paint);
#define SPS_READ_IENUM_IF_UNSET(v,s,d,i) if (!(v)->set) {sp_style_read_ienum((v), (s), (d), (i));}
#define SPS_READ_PENUM_IF_UNSET(v,r,k,d,i) if (!(v)->set) {sp_style_read_penum((v), (r), (k), (d), (i));}
@@ -453,8 +453,8 @@ sp_style_unref(SPStyle *style)
g_signal_handlers_disconnect_matched(G_OBJECT(style->object),
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, style);
if (style->text) sp_text_style_unref(style->text);
- sp_style_paint_clear(style, &style->fill, TRUE, FALSE);
- sp_style_paint_clear(style, &style->stroke, TRUE, FALSE);
+ sp_style_paint_clear(style, &style->fill);
+ sp_style_paint_clear(style, &style->stroke);
g_free(style->stroke_dash.dash);
g_free(style);
}
@@ -1934,13 +1934,13 @@ sp_style_paint_server_release(SPPaintServer *server, SPStyle *style)
if ((style->fill.type == SP_PAINT_TYPE_PAINTSERVER)
&& (server == style->fill.value.paint.server))
{
- sp_style_paint_clear(style, &style->fill, TRUE, FALSE);
+ sp_style_paint_clear(style, &style->fill);
}
if ((style->stroke.type == SP_PAINT_TYPE_PAINTSERVER)
&& (server == style->stroke.value.paint.server))
{
- sp_style_paint_clear(style, &style->stroke, TRUE, FALSE);
+ sp_style_paint_clear(style, &style->stroke);
}
}
@@ -1988,7 +1988,7 @@ sp_style_paint_server_modified(SPPaintServer *server, guint flags, SPStyle *styl
static void
sp_style_merge_ipaint(SPStyle *style, SPIPaint *paint, SPIPaint const *parent)
{
- sp_style_paint_clear(style, paint, TRUE, FALSE);
+ sp_style_paint_clear(style, paint);
if ((paint->set && paint->currentcolor) || parent->currentcolor) {
paint->currentcolor = TRUE;
@@ -2302,8 +2302,8 @@ sp_style_clear(SPStyle *style)
{
g_return_if_fail(style != NULL);
- sp_style_paint_clear(style, &style->fill, TRUE, FALSE);
- sp_style_paint_clear(style, &style->stroke, TRUE, FALSE);
+ sp_style_paint_clear(style, &style->fill);
+ sp_style_paint_clear(style, &style->stroke);
if (style->stroke_dash.dash) {
g_free(style->stroke_dash.dash);
}
@@ -3423,13 +3423,12 @@ sp_style_write_ifontsize(gchar *p, gint const len, gchar const *key,
/**
- * Clear paint object; conditionally disconnect style from paintserver.
+ * Clear paint object, and disconnect style from paintserver (if present).
*/
static void
-sp_style_paint_clear(SPStyle *style, SPIPaint *paint,
- unsigned hunref, unsigned unset)
+sp_style_paint_clear(SPStyle *style, SPIPaint *paint)
{
- if (hunref && (paint->type == SP_PAINT_TYPE_PAINTSERVER) && paint->value.paint.server) {
+ if ((paint->type == SP_PAINT_TYPE_PAINTSERVER) && paint->value.paint.server) {
if (paint == &style->fill) {
if (style->fill_hreffed) {
sp_object_hunref(SP_OBJECT(paint->value.paint.server), style);
@@ -3457,11 +3456,6 @@ sp_style_paint_clear(SPStyle *style, SPIPaint *paint,
paint->value.paint.uri = NULL;
paint->type = SP_PAINT_TYPE_NONE;
}
-
- if (unset) {
- paint->set = FALSE;
- paint->inherit = FALSE;
- }
}
/**