From 9094351b78c40b8ad59e86fcea438a27f666083b Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 15 Nov 2014 10:24:11 -0800 Subject: Purged SP_STYLE_ELEM/SP_IS_STYLE_ELEM macro abuse. (bzr r13711) --- src/sp-style-elem.cpp | 54 +++++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 32 deletions(-) (limited to 'src/sp-style-elem.cpp') diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp index 84f110134..da17b08d9 100644 --- a/src/sp-style-elem.cpp +++ b/src/sp-style-elem.cpp @@ -26,23 +26,18 @@ SPStyleElem::~SPStyleElem() { } void SPStyleElem::set(unsigned int key, const gchar* value) { - SPStyleElem* object = this; - - g_return_if_fail(object); - SPStyleElem &style_elem = *SP_STYLE_ELEM(object); - switch (key) { case SP_ATTR_TYPE: { if (!value) { /* TODO: `type' attribute is required. Give error message as per http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing. */ - style_elem.is_css = false; + is_css = false; } else { /* fixme: determine what whitespace is allowed. Will probably need to ask on SVG - * list; though the relevant RFC may give info on its lexer. */ - style_elem.is_css = ( g_ascii_strncasecmp(value, "text/css", 8) == 0 - && ( value[8] == '\0' || - value[8] == ';' ) ); + list; though the relevant RFC may give info on its lexer. */ + is_css = ( g_ascii_strncasecmp(value, "text/css", 8) == 0 + && ( value[8] == '\0' || + value[8] == ';' ) ); } break; } @@ -67,14 +62,18 @@ static void child_add_rm_cb(Inkscape::XML::Node *, Inkscape::XML::Node *, Inkscape::XML::Node *, void *const data) { - static_cast(data)->read_content(); + SPObject *obj = reinterpret_cast(data); + g_assert(data != NULL); + obj->read_content(); } static void content_changed_cb(Inkscape::XML::Node *, gchar const *, gchar const *, void *const data) { - static_cast(data)->read_content(); + SPObject *obj = reinterpret_cast(data); + g_assert(data != NULL); + obj->read_content(); } static void @@ -82,24 +81,22 @@ child_order_changed_cb(Inkscape::XML::Node *, Inkscape::XML::Node *, Inkscape::XML::Node *, Inkscape::XML::Node *, void *const data) { - static_cast(data)->read_content(); + SPObject *obj = reinterpret_cast(data); + g_assert(data != NULL); + obj->read_content(); } Inkscape::XML::Node* SPStyleElem::write(Inkscape::XML::Document* xml_doc, Inkscape::XML::Node* repr, guint flags) { - SPStyleElem* object = this; - if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { repr = xml_doc->createElement("svg:style"); } - g_return_val_if_fail(object, repr); - SPStyleElem &style_elem = *SP_STYLE_ELEM(object); if (flags & SP_OBJECT_WRITE_BUILD) { g_warning("nyi: Forming