Logo Search packages:      
Sourcecode: inkscape version File versions

SPStyle* sp_style_unref ( SPStyle style  ) 

Decrease refcount of style with possible destruction.

Definition at line 507 of file style.cpp.

References SPIPaint::clear(), NRVpathDash::dash, SPStyle::fill, SPStyle::fill_ps_modified_connection, SPStyle::filter, SPStyle::filter_modified_connection, SPIFilter::href, SPIPaint::href, SPStyle::refcount, SPStyle::release_connection, sp_style_filter_clear(), sp_text_style_unref(), SPStyle::stroke, SPStyle::stroke_dash, SPStyle::stroke_ps_modified_connection, SPStyle::text, and SPIPaint::value.

Referenced by SPObject::releaseReferences(), sp_desktop_get_font_size_tool(), and sp_style_read().

{
    g_return_val_if_fail(style != NULL, NULL);
    g_return_val_if_fail(style->refcount > 0, NULL);

    style->refcount -= 1;

    if (style->refcount < 1) {
        style->release_connection.disconnect();
        style->release_connection.~connection();
        if (style->text) sp_text_style_unref(style->text);

         if (style->fill.value.href) {
             style->fill_ps_modified_connection.disconnect();
             delete style->fill.value.href;
             style->fill.value.href = NULL;
         }
         if (style->stroke.value.href) {
             style->stroke_ps_modified_connection.disconnect();
             delete style->stroke.value.href;
             style->stroke.value.href = NULL;
         }
         if (style->filter.href) {
             style->filter_modified_connection.disconnect();
             delete style->filter.href;
             style->filter.href = NULL;
         }

        style->filter_modified_connection.~connection();
        style->fill_ps_modified_connection.~connection();
        style->stroke_ps_modified_connection.~connection();

        style->fill.clear();
        style->stroke.clear();
        sp_style_filter_clear(style);

        g_free(style->stroke_dash.dash);
        g_free(style);
    }

    return NULL;
}


Generated by  Doxygen 1.6.0   Back to index