Logo Search packages:      
Sourcecode: inkscape version File versions

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

Write SPIScale24 object into string.

Definition at line 3291 of file style.cpp.

References SPIScale24::inherit, SPIScale24::set, Inkscape::CSSOStringStream::str(), and SPIScale24::value.

Referenced by sp_style_write_difference(), and sp_style_write_string().

{
    Inkscape::CSSOStringStream os;

    if ((flags & SP_STYLE_FLAG_ALWAYS)
        || ((flags & SP_STYLE_FLAG_IFSET) && val->set)
        || ((flags & SP_STYLE_FLAG_IFDIFF) && val->set
            && (!base->set || (val->value != base->value))))
    {
        if (val->inherit) {
            return g_snprintf(p, len, "%s:inherit;", key);
        } else {
            os << key << ":" << SP_SCALE24_TO_FLOAT(val->value) << ";";
            return g_strlcpy(p, os.str().c_str(), len);
        }
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index