From 67c3fc5586ae05506f75bb30fe46a071e20613d2 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 24 Apr 2014 14:04:31 +0200 Subject: Clean up of style code, removal of SPFontStyle. Step 2. (bzr r13300) --- src/desktop-style.cpp | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index bab9635a9..a7097b4c9 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -1227,11 +1227,11 @@ objects_query_fontfamily (GSList *objects, SPStyle *style_res) bool different = false; int texts = 0; - if (style_res->text->font_family.value) { - g_free(style_res->text->font_family.value); - style_res->text->font_family.value = NULL; + if (style_res->font_family.value) { + g_free(style_res->font_family.value); + style_res->font_family.value = NULL; } - style_res->text->font_family.set = FALSE; + style_res->font_family.set = FALSE; for (GSList const *i = objects; i != NULL; i = i->next) { SPObject *obj = SP_OBJECT (i->data); @@ -1250,21 +1250,21 @@ objects_query_fontfamily (GSList *objects, SPStyle *style_res) texts ++; - if (style_res->text->font_family.value && style->text->font_family.value && - strcmp (style_res->text->font_family.value, style->text->font_family.value)) { + if (style_res->font_family.value && style->font_family.value && + strcmp (style_res->font_family.value, style->font_family.value)) { different = true; // different fonts } - if (style_res->text->font_family.value) { - g_free(style_res->text->font_family.value); - style_res->text->font_family.value = NULL; + if (style_res->font_family.value) { + g_free(style_res->font_family.value); + style_res->font_family.value = NULL; } - style_res->text->font_family.set = TRUE; - style_res->text->font_family.value = g_strdup(style->text->font_family.value); + style_res->font_family.set = TRUE; + style_res->font_family.value = g_strdup(style->font_family.value); } - if (texts == 0 || !style_res->text->font_family.set) { + if (texts == 0 || !style_res->font_family.set) { return QUERY_STYLE_NOTHING; } @@ -1285,11 +1285,11 @@ objects_query_fontspecification (GSList *objects, SPStyle *style_res) bool different = false; int texts = 0; - if (style_res->text->font_specification.value) { - g_free(style_res->text->font_specification.value); - style_res->text->font_specification.value = NULL; + if (style_res->font_specification.value) { + g_free(style_res->font_specification.value); + style_res->font_specification.value = NULL; } - style_res->text->font_specification.set = FALSE; + style_res->font_specification.set = FALSE; for (GSList const *i = objects; i != NULL; i = i->next) { SPObject *obj = SP_OBJECT (i->data); @@ -1308,21 +1308,21 @@ objects_query_fontspecification (GSList *objects, SPStyle *style_res) texts ++; - if (style_res->text->font_specification.value && style_res->text->font_specification.set && - style->text->font_specification.value && style->text->font_specification.set && - strcmp (style_res->text->font_specification.value, style->text->font_specification.value)) { + if (style_res->font_specification.value && style_res->font_specification.set && + style->font_specification.value && style->font_specification.set && + strcmp (style_res->font_specification.value, style->font_specification.value)) { different = true; // different fonts } - if (style->text->font_specification.set) { + if (style->font_specification.set) { - if (style_res->text->font_specification.value) { - g_free(style_res->text->font_specification.value); - style_res->text->font_specification.value = NULL; + if (style_res->font_specification.value) { + g_free(style_res->font_specification.value); + style_res->font_specification.value = NULL; } - style_res->text->font_specification.set = TRUE; - style_res->text->font_specification.value = g_strdup(style->text->font_specification.value); + style_res->font_specification.set = TRUE; + style_res->font_specification.value = g_strdup(style->font_specification.value); } } -- cgit v1.2.3 From 20452bbd40fe1d93b2093cb5dea8e4cb8ae967d3 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 24 Apr 2014 14:53:30 +0200 Subject: Clean up of style code: refactor marker properties. Step 3. (bzr r13301) --- src/desktop-style.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index a7097b4c9..37f537cc5 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -722,10 +722,10 @@ objects_query_strokewidth (GSList *objects, SPStyle *style_res) } if ( style->stroke.isNone() && !( - style->marker[SP_MARKER_LOC].set || // stroke width affects markers, so if there's no stroke but only markers then we should - style->marker[SP_MARKER_LOC_START].set || // still calculate the stroke width - style->marker[SP_MARKER_LOC_MID].set || - style->marker[SP_MARKER_LOC_END].set)) + style->marker.set || // stroke width affects markers, so if there's no + style->marker_start.set || // stroke but only markers then we should + style->marker_mid.set || // still calculate the stroke width + style->marker_end.set)) { continue; } -- cgit v1.2.3