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

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

Write SPIFloat object into string.

Definition at line 3259 of file style.cpp.

References SPIFloat::inherit, SPIFloat::set, Inkscape::CSSOStringStream::str(), and SPIFloat::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 << ":" << val->value << ";";
            return g_strlcpy(p, os.str().c_str(), len);
        }
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index