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

static gint sp_style_write_istring ( gchar *  p,
gint const   len,
gchar const *const   key,
SPIString const *const   val,
SPIString const *const   base,
guint const   flags 
) [static]

Write SPIString object into string.

Definition at line 3337 of file style.cpp.

References css2_escape_quote(), SPIString::inherit, SPIString::set, and SPIString::value.

Referenced by sp_text_style_write().

{
    if ((flags & SP_STYLE_FLAG_ALWAYS)
        || ((flags & SP_STYLE_FLAG_IFSET) && val->set)
        || ((flags & SP_STYLE_FLAG_IFDIFF) && val->set
            && (!base->set || strcmp(val->value, base->value))))
    {
        if (val->inherit) {
            return g_snprintf(p, len, "%s:inherit;", key);
        } else {
            gchar *val_quoted = css2_escape_quote(val->value);
            return g_snprintf(p, len, "%s:%s;", key, val_quoted);
            g_free (val_quoted);
        }
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index