Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

static void sp_style_merge_style_from_decl ( SPStyle *const   style,
CRDeclaration const *const   decl 
) [static]

Todo:
Ensure that property is lcased, as per http://www.w3.org/TR/REC-CSS2/syndata.html#q4. Should probably be done in libcroco.

Todo:
effic: Test whether the property is already set before trying to convert to string. Alternatively, set from CRTerm directly rather than converting to string.

Definition at line 1154 of file style.cpp.

References cr_term_to_string(), SP_ATTR_INVALID, sp_attribute_lookup(), and sp_style_merge_property().

Referenced by sp_style_merge_from_decl_list().

{
    /** \todo Ensure that property is lcased, as per
     * http://www.w3.org/TR/REC-CSS2/syndata.html#q4.
     * Should probably be done in libcroco.
     */
    unsigned const prop_idx = sp_attribute_lookup(decl->property->stryng->str);
    if (prop_idx != SP_ATTR_INVALID) {
        /** \todo
         * effic: Test whether the property is already set before trying to
         * convert to string. Alternatively, set from CRTerm directly rather
         * than converting to string.
         */
        guchar *const str_value_unsigned = cr_term_to_string(decl->value);
        gchar *const str_value = reinterpret_cast<gchar *>(str_value_unsigned);
        sp_style_merge_property(style, prop_idx, str_value);
        g_free(str_value);
    }
}


Generated by  Doxygen 1.6.0   Back to index